From 0ba4562932964ebc01c7d3ca651ab5043c01c7f1 Mon Sep 17 00:00:00 2001 From: Metta Crawler Date: Thu, 27 Aug 2020 08:16:24 -0400 Subject: [PATCH] Packer 1.6.1 compatibility. Ran: $ packer fix -var-file=ubuntu1804.json ubuntu.json > foo.json $ mv foo.json ubuntu.json Tested with: $ packer build -var-file=ubuntu1804.json ubuntu.json --- ubuntu/ubuntu.json | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/ubuntu/ubuntu.json b/ubuntu/ubuntu.json index 8bf993b..890cd06 100644 --- a/ubuntu/ubuntu.json +++ b/ubuntu/ubuntu.json @@ -2,7 +2,6 @@ "_comment": "Build with `packer build ubuntu.json`", "builders": [ { - "type": "qemu", "boot_command": [ "{{ user `boot_command_prefix` }}", "/install/vmlinuz noapic ", @@ -25,24 +24,39 @@ ], "headless": "{{ user `headless` }}", "http_directory": "http", - "iso_checksum": "{{ user `iso_checksum` }}", - "iso_checksum_type": "{{ user `iso_checksum_type` }}", + "iso_checksum": "{{ user `iso_checksum_type` }}:{{ user `iso_checksum` }}", "iso_urls": [ "{{ user `iso_url` }}" ], "output_directory": "output-{{ user `vm_name` }}", + "qemuargs": [ + [ + "-m", + "{{ user `memory` }}" + ], + [ + "-display", + "none" + ], + [ + "-machine", + "accel=kvm" + ], + [ + "-cpu", + "host" + ], + [ + "-smp", + "cpus={{ user `cpus`}}" + ] + ], "shutdown_command": "echo '{{ user `ssh_password` }}'|sudo -S shutdown -P now", "ssh_password": "{{ user `ssh_password` }}", + "ssh_timeout": "10000s", "ssh_username": "{{ user `ssh_username` }}", - "ssh_wait_timeout": "10000s", - "vm_name": "{{ user `vm_name` }}", - "qemuargs": [ - [ "-m", "{{ user `memory` }}" ], - [ "-display", "none" ], - [ "-machine", "accel=kvm" ], - [ "-cpu", "host" ], - [ "-smp", "cpus={{ user `cpus`}}"] - ] + "type": "qemu", + "vm_name": "{{ user `vm_name` }}" } ], "provisioners": [ @@ -79,10 +93,11 @@ "disk_size": "65536", "ftp_proxy": "{{env `ftp_proxy`}}", "headless": "", + "hostname": "vagrant", "http_proxy": "{{env `http_proxy`}}", "https_proxy": "{{env `https_proxy`}}", - "install_vagrant_key": "true", "install_dev_packages": "false", + "install_vagrant_key": "true", "iso_checksum": "de5ee8665048f009577763efbf4a6f0558833e59", "iso_checksum_type": "sha1", "iso_name": "ubuntu-16.04-server-amd64.iso", @@ -90,9 +105,8 @@ "locale": "en_US", "memory": "512", "no_proxy": "{{env `no_proxy`}}", - "preseed" : "preseed.cfg", + "preseed": "preseed.cfg", "rsync_proxy": "{{env `rsync_proxy`}}", - "hostname": "vagrant", "ssh_fullname": "vagrant", "ssh_password": "vagrant", "ssh_username": "vagrant", @@ -102,3 +116,4 @@ "vm_name": "ubuntu1604" } } +