From 5a3526a6692972bd027456ca0349223dcf1f3ad6 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Wed, 21 Oct 2020 15:55:54 +0200 Subject: [PATCH] Add vmware vmx example --- examples/hcl/linux/build.ubuntu.pkr.hcl | 5 +++++ examples/hcl/linux/source.vmware-vmx.pkr.hcl | 16 ++++++++++++++++ examples/hcl/linux/variables.16.04.pkr.hcl | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 examples/hcl/linux/source.vmware-vmx.pkr.hcl diff --git a/examples/hcl/linux/build.ubuntu.pkr.hcl b/examples/hcl/linux/build.ubuntu.pkr.hcl index 2c5bb1022..f6781f6f6 100644 --- a/examples/hcl/linux/build.ubuntu.pkr.hcl +++ b/examples/hcl/linux/build.ubuntu.pkr.hcl @@ -58,6 +58,11 @@ EOF boot_command = local.ubuntu_1604_boot_command } + source "source.vmware-vmx.base-ubuntu-amd64" { + name = "16.04" + source_path = "vmware_iso_ubuntu_1604_amd64/packer-base-ubuntu-amd64.vmx" + } + source "source.vmware-iso.base-ubuntu-amd64" { name = "18.04" iso_url = local.iso_url_ubuntu_1804 diff --git a/examples/hcl/linux/source.vmware-vmx.pkr.hcl b/examples/hcl/linux/source.vmware-vmx.pkr.hcl new file mode 100644 index 000000000..a4a6713a6 --- /dev/null +++ b/examples/hcl/linux/source.vmware-vmx.pkr.hcl @@ -0,0 +1,16 @@ +source "vmware-vmx" "base-ubuntu-amd64" { + headless = var.headless + boot_wait = "10s" + http_directory = local.http_directory + shutdown_command = "echo 'vagrant' | sudo -S shutdown -P now" + ssh_password = "vagrant" + ssh_port = 22 + ssh_timeout = "10000s" + ssh_username = "vagrant" + tools_upload_flavor = "linux" + vmx_data = { + "cpuid.coresPerSocket" = "1" + "ethernet0.pciSlotNumber" = "32" + } + vmx_remove_ethernet_interfaces = true +} diff --git a/examples/hcl/linux/variables.16.04.pkr.hcl b/examples/hcl/linux/variables.16.04.pkr.hcl index 9feac1b18..953f52a7e 100644 --- a/examples/hcl/linux/variables.16.04.pkr.hcl +++ b/examples/hcl/linux/variables.16.04.pkr.hcl @@ -1,5 +1,5 @@ variable "ubuntu_1604_version" { - default = "16.04.6" + default = "16.04.7" } locals {