{ "variables": { "iso_url": "https://dl-cdn.alpinelinux.org/alpine/v3.15/releases/x86_64/alpine-virt-3.15.0-x86_64.iso", "iso_checksum": "e97eaedb3bff39a081d1d7e67629d5c0e8fb39677d6a9dd1eaf2752e39061e02", "ui_mode": "cli", "vm_name": "alpine_cli.qcow2", "file_source": "README.rst", "setup_script": "setup.sh", "disk_size": "500" }, "builders": [ { "type": "qemu", "iso_url": "{{user `iso_url`}}", "iso_checksum": "{{user `iso_checksum`}}", "iso_checksum_type": "sha256", "shutdown_command": "poweroff", "headless": true, "ssh_username": "root", "ssh_password": "root", "vm_name": "{{user `vm_name`}}", "disk_interface": "ide", "disk_compression": true, "net_device": "e1000", "disk_size": "{{user `disk_size`}}", "boot_wait": "20s", "ssh_wait_timeout": "60s", "boot_command": [ "root", "echo 'root:root' | chpasswd", "ifconfig lo up", "ifconfig eth0 up && udhcpc -i eth0", "setup-sshd -c openssh", "sed -i.orig '$aPermitRootLogin yes' /etc/ssh/sshd_config", "service sshd restart" ] } ], "provisioners": [ { "type": "shell", "script": "scripts/install.sh" }, { "type": "shell", "inline": [ "reboot" ] }, { "type": "shell", "pause_before": "20s", "inline": [ "apk upgrade --update-cache", "mkdir -p /tmp/uploads" ] }, { "type": "shell", "script": "scripts/{{user `ui_mode`}}.sh" }, { "type": "file", "source": "files/{{user `file_source`}}", "destination": "/tmp/uploads/" }, { "type": "shell", "script": "scripts/{{user `setup_script`}}" }, { "type": "shell", "script": "scripts/post_setup.sh" } ] }