|
@ -1,33 +1,24 @@ |
|
|
{ |
|
|
{ |
|
|
"variables": { |
|
|
"variables": { |
|
|
"memory": "4G", |
|
|
|
|
|
"cpus": "2", |
|
|
|
|
|
|
|
|
"iso_url": "http://dl-cdn.alpinelinux.org/alpine/v3.9/releases/x86_64/alpine-standard-3.9.3-x86_64.iso", |
|
|
|
|
|
"iso_checksum": "6e28c5c902ccb6db24596dfb6a1c255c7989d0b9be4e92e87a8eff523201a459", |
|
|
|
|
|
"iso_checksum_type": "sha256", |
|
|
|
|
|
|
|
|
"iso_url": "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-9.8.0-amd64-netinst.iso", |
|
|
|
|
|
"iso_checksum": "cc4a6bd50925c1c4af98049060e304494bc9da61eb5eb272c556d67608de14d4e6a4b8bc1c9412a0f810083912e228569f3771ffffa7174538f3e26f45a05245", |
|
|
|
|
|
"iso_checksum_type": "sha512", |
|
|
|
|
|
|
|
|
|
|
|
"boot_wait": "3s", |
|
|
|
|
|
|
|
|
"boot_wait": "10s", |
|
|
"boot_key_interval": "10ms", |
|
|
"boot_key_interval": "10ms", |
|
|
|
|
|
|
|
|
"ssh_username": "unifi", |
|
|
|
|
|
"ssh_password": "uuunifi", |
|
|
|
|
|
|
|
|
"root_password": "uuunifi", |
|
|
"ssh_timeout": "60m", |
|
|
"ssh_timeout": "60m", |
|
|
|
|
|
|
|
|
"machine_hostname": "unifi-controller", |
|
|
|
|
|
"machine_domain": "lab.uncomfortably.online", |
|
|
|
|
|
|
|
|
"machine_hostname": "unifi", |
|
|
|
|
|
|
|
|
"http_directory": "http/", |
|
|
|
|
|
"preseed_file": "preseed.cfg" |
|
|
|
|
|
|
|
|
"http_directory": "http/" |
|
|
}, |
|
|
}, |
|
|
"builders": [ |
|
|
"builders": [ |
|
|
{ |
|
|
{ |
|
|
"type": "qemu", |
|
|
"type": "qemu", |
|
|
"accelerator": "kvm", |
|
|
"accelerator": "kvm", |
|
|
"qemuargs": [ |
|
|
|
|
|
[ "-m", "{{ user `memory` }}" ], |
|
|
|
|
|
[ "-smp", "cpus={{ user `cpus`}}"] |
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
"disk_interface": "virtio", |
|
|
|
|
|
|
|
|
"iso_url": "{{user `iso_url`}}", |
|
|
"iso_url": "{{user `iso_url`}}", |
|
|
"iso_checksum": "{{user `iso_checksum`}}", |
|
|
"iso_checksum": "{{user `iso_checksum`}}", |
|
@ -38,26 +29,36 @@ |
|
|
"boot_wait": "{{user `boot_wait`}}", |
|
|
"boot_wait": "{{user `boot_wait`}}", |
|
|
"boot_key_interval": "{{user `boot_key_interval`}}", |
|
|
"boot_key_interval": "{{user `boot_key_interval`}}", |
|
|
"boot_command": [ |
|
|
"boot_command": [ |
|
|
"<esc><wait>", |
|
|
|
|
|
"install ", |
|
|
|
|
|
"auto=true ", |
|
|
|
|
|
"url=http://{{.HTTPIP}}:{{.HTTPPort}}/{{user `preseed_file`}} ", |
|
|
|
|
|
|
|
|
"root<enter><wait>", |
|
|
|
|
|
|
|
|
|
|
|
"ifconfig eth0 up && ", |
|
|
|
|
|
"udhcpc -i eth0<enter>", |
|
|
|
|
|
"<wait5>", |
|
|
|
|
|
|
|
|
|
|
|
"wget http://{{ .HTTPIP }}:{{ .HTTPPort }}/answers<enter><wait>", |
|
|
|
|
|
"sed -i ", |
|
|
|
|
|
"-e \"s/:hostname:/{{user `machine_hostname`}}/g\" ", |
|
|
|
|
|
"answers<enter>", |
|
|
|
|
|
|
|
|
|
|
|
"sed -i \"s/rc-service \\$svc start/#&/\" /sbin/setup-sshd<enter>", |
|
|
|
|
|
|
|
|
"hostname={{user `machine_hostname`}} ", |
|
|
|
|
|
"domain={{user `machine_domain`}} ", |
|
|
|
|
|
"interface=auto ", |
|
|
|
|
|
|
|
|
"setup-alpine -f answers && ", |
|
|
|
|
|
"mount /dev/vda3 /mnt && ", |
|
|
|
|
|
"echo 'PermitRootLogin yes' >> /mnt/etc/ssh/sshd_config && ", |
|
|
|
|
|
"umount /mnt && ", |
|
|
|
|
|
"reboot", |
|
|
|
|
|
"<enter>", |
|
|
|
|
|
"<wait5>", |
|
|
|
|
|
|
|
|
"passwd/user-fullname={{user `ssh_username`}} ", |
|
|
|
|
|
"passwd/username={{user `ssh_username`}} ", |
|
|
|
|
|
"passwd/user-password={{user `ssh_password`}} ", |
|
|
|
|
|
"passwd/user-password-again={{user `ssh_password`}} ", |
|
|
|
|
|
|
|
|
"{{user `root_password`}}<enter><wait>", |
|
|
|
|
|
"{{user `root_password`}}<enter><wait20>", |
|
|
|
|
|
|
|
|
"<enter>" |
|
|
|
|
|
|
|
|
"y<enter>" |
|
|
], |
|
|
], |
|
|
|
|
|
|
|
|
"communicator": "ssh", |
|
|
"communicator": "ssh", |
|
|
"ssh_username": "{{user `ssh_username`}}", |
|
|
|
|
|
"ssh_password": "{{user `ssh_password`}}", |
|
|
|
|
|
|
|
|
"ssh_username": "root", |
|
|
|
|
|
"ssh_password": "{{user `root_password`}}", |
|
|
"ssh_timeout": "{{user `ssh_timeout`}}" |
|
|
"ssh_timeout": "{{user `ssh_timeout`}}" |
|
|
} |
|
|
} |
|
|
] |
|
|
] |