2020-08-03 10:27:15 +00:00
|
|
|
{
|
|
|
|
"variables": {
|
2022-12-23 01:27:21 +00:00
|
|
|
"iso_url": "https://dl-cdn.alpinelinux.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.0-x86_64.iso",
|
|
|
|
"iso_checksum": "file:https://dl-cdn.alpinelinux.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.0-x86_64.iso.sha256",
|
2020-08-12 12:38:43 +00:00
|
|
|
"ui_mode": "cli",
|
2020-08-03 10:27:15 +00:00
|
|
|
"vm_name": "alpine_cli.qcow2",
|
2020-08-12 12:38:43 +00:00
|
|
|
"file_source": "README.rst",
|
2020-08-03 10:27:15 +00:00
|
|
|
"setup_script": "setup.sh",
|
|
|
|
"disk_size": "500"
|
|
|
|
},
|
|
|
|
"builders": [
|
|
|
|
{
|
|
|
|
"type": "qemu",
|
|
|
|
"iso_url": "{{user `iso_url`}}",
|
|
|
|
"iso_checksum": "{{user `iso_checksum`}}",
|
|
|
|
"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<enter><wait>",
|
|
|
|
"echo 'root:root' | chpasswd<enter>",
|
|
|
|
"ifconfig lo up<enter>",
|
|
|
|
"ifconfig eth0 up && udhcpc -i eth0<enter><wait10>",
|
|
|
|
"setup-sshd -c openssh<enter><wait>",
|
|
|
|
"sed -i.orig '$aPermitRootLogin yes' /etc/ssh/sshd_config<enter>",
|
|
|
|
"service sshd restart<enter><wait>"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"provisioners": [
|
|
|
|
{
|
|
|
|
"type": "shell",
|
|
|
|
"script": "scripts/install.sh"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "shell",
|
|
|
|
"inline": [
|
|
|
|
"reboot"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "shell",
|
|
|
|
"pause_before": "20s",
|
|
|
|
"inline": [
|
2020-08-12 12:38:43 +00:00
|
|
|
"apk upgrade --update-cache",
|
|
|
|
"mkdir -p /tmp/uploads"
|
2020-08-03 10:27:15 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "shell",
|
2020-08-12 12:38:43 +00:00
|
|
|
"script": "scripts/{{user `ui_mode`}}.sh"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "file",
|
|
|
|
"source": "files/{{user `file_source`}}",
|
|
|
|
"destination": "/tmp/uploads/"
|
2020-08-03 10:27:15 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "shell",
|
|
|
|
"script": "scripts/{{user `setup_script`}}"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "shell",
|
|
|
|
"script": "scripts/post_setup.sh"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|