From 1475b08a78eaef9c771229fb27d44fe51290d754 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 12 Dec 2020 15:51:27 +0100 Subject: [PATCH] packer: make template compatible with recent packer versions The packer template worked with packer v1.5.6, but fails with more recent versions like v1.6.5. Fixed via `packer fix debian64.json`, using packer v1.6.5. Thanks: Darshaka Pathirana for reporting Closes: grml/grml-debootstrap#162 --- packer/debian64.json | 116 ++++++++++++++++++++++++++------------------------- 1 file changed, 60 insertions(+), 56 deletions(-) diff --git a/packer/debian64.json b/packer/debian64.json index 1e684a1..ce1ff85 100644 --- a/packer/debian64.json +++ b/packer/debian64.json @@ -1,78 +1,82 @@ { - "variables": { - "grml_type": "grml64-full", - "grml_version": "2020.06-rc1", - "grml_iso_checksum": "b28b54e55fc5fe1569e0201e918da49be0885646", - "debian_version": "buster", - "grml_debootstrap_version": "latest", - "grml_debootstrap_local_path": "doesnotexist" - }, - "builders": [ - { - "type": "virtualbox-iso", - "vm_name": "{{ user `grml_type` }}_{{ user `grml_version` }}", - "guest_os_type": "Debian_64", - "hard_drive_interface": "sata", - "iso_url": "http://download.grml.org/devel/{{ user `grml_type` }}_{{ user `grml_version` }}.iso", - "iso_checksum": "{{ user `grml_iso_checksum` }}", - "iso_checksum_type": "sha1", - "ssh_wait_timeout": "20m", - "ssh_username": "root", - "ssh_password": "grml", - "output_directory": "{{ user `grml_type` }}_output", - "headless": false, - "boot_wait": "5s", - "boot_command": [ - " ssh=grml " - ], - "shutdown_command": "shutdown -h now", - "guest_additions_url": "https://download.virtualbox.org/virtualbox/6.1.10/VBoxGuestAdditions_6.1.10.iso", - "guest_additions_sha256": "62a0c6715bee164817a6f58858dec1d60f01fd0ae00a377a75bbf885ddbd0a61", - "vboxmanage": [ - ["modifyvm", "{{.Name}}", "--memory", "1024"] - ] - } + { + "boot_command": [ + " ssh=grml " + ], + "boot_wait": "5s", + "guest_additions_sha256": "62a0c6715bee164817a6f58858dec1d60f01fd0ae00a377a75bbf885ddbd0a61", + "guest_additions_url": "https://download.virtualbox.org/virtualbox/6.1.10/VBoxGuestAdditions_6.1.10.iso", + "guest_os_type": "Debian_64", + "hard_drive_interface": "sata", + "headless": false, + "iso_checksum": "sha1:{{ user `grml_iso_checksum` }}", + "iso_url": "http://download.grml.org/devel/{{ user `grml_type` }}_{{ user `grml_version` }}.iso", + "output_directory": "{{ user `grml_type` }}_output", + "shutdown_command": "shutdown -h now", + "ssh_password": "grml", + "ssh_timeout": "20m", + "ssh_username": "root", + "type": "virtualbox-iso", + "vboxmanage": [ + [ + "modifyvm", + "{{.Name}}", + "--memory", + "1024" + ] + ], + "vm_name": "{{ user `grml_type` }}_{{ user `grml_version` }}" + } + ], + "post-processors": [ + { + "override": { + "virtualbox": { + "output": "debian64_{{ user `debian_version` }}.box" + } + }, + "type": "vagrant" + } ], - "provisioners": [ + "provisioners": [ { - "type": "file", + "destination": "/tmp/fake-uname.so", "source": "fake-uname.so", - "destination": "/tmp/fake-uname.so" + "type": "file" }, { - "type": "file", + "destination": "/tmp/debian64.bats", "source": "debian64.bats", - "destination": "/tmp/debian64.bats" + "type": "file" }, { - "type": "shell", - "inline": "mkdir -vp /tmp/grml-debootstrap/" + "inline": "mkdir -vp /tmp/grml-debootstrap/", + "type": "shell" }, { - "type": "file", + "destination": "/tmp/grml-debootstrap/", "source": "{{ user `grml_debootstrap_local_path` }}/", - "destination": "/tmp/grml-debootstrap/" + "type": "file" }, { - "type": "shell", "environment_vars": [ - "GRML_DEBOOTSTRAP_VERSION={{ user `grml_debootstrap_version` }}", - "DEBIAN_VERSION={{ user `debian_version` }}" + "GRML_DEBOOTSTRAP_VERSION={{ user `grml_debootstrap_version` }}", + "DEBIAN_VERSION={{ user `debian_version` }}" ], "scripts": [ "debian64_provision.sh" - ] + ], + "type": "shell" } ], - "post-processors": [ - { - "type": "vagrant", - "override": { - "virtualbox": { - "output": "debian64_{{ user `debian_version` }}.box" - } - } - } - ] + "variables": { + "debian_version": "buster", + "grml_debootstrap_local_path": "doesnotexist", + "grml_debootstrap_version": "latest", + "grml_iso_checksum": "b28b54e55fc5fe1569e0201e918da49be0885646", + "grml_type": "grml64-full", + "grml_version": "2020.06-rc1" + } } + -- 2.1.4