{ "variables": { "iso_name": "ubuntu-24.04-live-server-amd64.iso", "iso_url": "https://old-releases.ubuntu.com/releases/24.04/ubuntu-24.04-live-server-amd64.iso", "iso_path": "{{pwd}}/iso/{{user `iso_name`}}", "iso_sha256": "sha256:8762f7e74e4d64d72fceb5f70682e6b069932deedb4949c6975d0f0fe0a91be3", "timestamp": "{{isotime `2006-01-02`}}", "headless": "false", "boot_wait": "5s", "local_iso_url": "", "local_iso": "{{user `local_iso_url`}}/{{user `iso_name`}}", "output": "", "name": "ubuntu-24.04-server", "cpu": "2", "cores": "2", "ram": "2048", "disk_size": "102400", "communicator_username": "root", "communicator_password": "root", "lowpriv_user": "ubuntu" }, "builders": [ { "type": "qemu", "format": "qcow2", "accelerator": "kvm", "net_device": "virtio-net", "disk_interface": "virtio", "headless": "{{user `headless`}}", "name": "qemu", "vm_name": "qemu-{{user `name`}}_{{user `timestamp`}}", "disk_size": "{{user `disk_size`}}", "disk_cache": "none", "disk_discard": "unmap", "disk_compression": true, "communicator": "ssh", "ssh_username": "{{user `communicator_username`}}", "ssh_password": "{{user `communicator_password`}}", "ssh_pty": true, "ssh_timeout": "60m", "ssh_handshake_attempts": "1337", "shutdown_command": "shutdown -P now", "boot_wait": "{{user `boot_wait`}}", "boot_command": [ "c", "set gfxpayload=keep", "linux /casper/vmlinuz --- quiet splash autoinstall ds='nocloud-net;seedfrom=http://{{.HTTPIP}}:{{.HTTPPort}}/'", "initrd /casper/initrd", "boot" ], "iso_urls": [ "{{user `iso_path`}}", "{{user `local_iso`}}", "{{user `iso_url`}}" ], "iso_checksum": "{{user `iso_sha256`}}", "iso_target_path": "{{user `iso_path`}}", "http_directory": "files/answer_files/linux/ubuntu/24.04-server", "output_directory": "qemu_output_{{user `name`}}", "qemuargs": [ ["-m", "{{user `ram`}}M"], ["-cpu", "host"], ["-smp", "cpus={{user `cpu`}}"] ] } ], "provisioners": [ { "type": "shell", "script": "files/scripts/linux/setup-qemu-guest-agent.sh" }, { "type": "shell", "script": "files/scripts/linux/sysprep.sh" } ], "post-processors": [ { "type": "shell-local", "only_on": ["linux"], "environment_vars": [ "NAME={{user `name`}}", "TIMESTAMP={{user `timestamp`}}", "OUTPUT={{user `output`}}" ], "script": "files/scripts/create-checksums.sh" } ] }