diff --git a/packer/debian_buster.qemu.json b/packer/debian_buster.qemu.json new file mode 100644 --- /dev/null +++ b/packer/debian_buster.qemu.json @@ -0,0 +1,72 @@ +{ + "variables": { + "DISK_SIZE": "5120", + "IMAGE_TIMESTAMP": "{{isotime \"20060102-1504\"}}", + "PACKER_BOX_NAME": "swh-debian-10.6-amd64-{{ user `IMAGE_TIMESTAMP` }}" + }, + "builders": [ + { + "headless": false, + "type": "qemu", + "format": "qcow2", + "accelerator": "kvm", + "net_device": "virtio-net", + "disk_interface": "virtio", + "memory": 2048, + "cpus": 2, + + "boot_command": [ + "", + "install ", + "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/buster-preseed.cfg ", + "debian-installer=en_US.UTF-8 ", + "auto ", + "locale=en_US.UTF-8 ", + "kbd-chooser/method=us ", + "keyboard-configuration/xkb-keymap=us ", + "netcfg/get_hostname={{ .Name }} ", + "netcfg/get_domain=vagrantup.com ", + "fb=false ", + "debconf/frontend=noninteractive ", + "console-setup/ask_detect=false ", + "console-keymaps-at/keymap=us ", + "grub-installer/bootdev=/dev/vda ", + "" + ], + + "boot_wait": "5s", + "disk_size": "{{ user `DISK_SIZE` }}", + "ssh_username": "vagrant", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_wait_timeout": "1000s", + "output_directory": "output", + "http_directory": "http", + "iso_urls": [ + "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.6.0-amd64-netinst.iso" + ], + "iso_checksum": "2af8f43d4a7ab852151a7f630ba596572213e17d3579400b5648eba4cc974ed0", + "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", + "vm_name": "{{ user `PACKER_BOX_NAME` }}" + }], + "provisioners": [ + { + "type": "shell", + "expect_disconnect": "true", + "execute_command": "echo 'vagrant'|{{.Vars}} sudo -S -E bash '{{.Path}}'", + "scripts": [ + "scripts/post-install.sh" + ] + } + ], + + "post-processors": [ + [ + { + "type": "vagrant", + "compression_level": 9, + "output": "builds/{{ user `PACKER_BOX_NAME` }}.qcow2" + } + ] + ] +}