| { |
| "variables": { |
| "user": "root", |
| "password": "ho5uo7Uome5d", |
| "do_api_token": "{{ env `DO_API_TOKEN` }}", |
| "distro": "mcp-mirror-image", |
| "disk_size": "150000", |
| "cluster_model": "{{ env `CLUSTER_MODEL` }}", |
| "cluster_model_ref": "{{ env `CLUSTER_MODEL_REF` }}", |
| "cluster_name": "{{ env `CLUSTER_NAME` }}", |
| "formula_version": "{{ env `FORMULA_VERSION` }}", |
| "mcp_version": "{{ env `MCP_VERSION` }}" |
| }, |
| "provisioners": [ |
| { |
| "environment_vars": [ |
| "CLUSTER_MODEL={{ user `cluster_model` }}", |
| "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}", |
| "CLUSTER_NAME={{ user `cluster_name` }}", |
| "FORMULA_VERSION={{ user `formula_version` }}" |
| ], |
| "type": "shell", |
| "expect_disconnect": "true", |
| "override": { |
| "qemu": { |
| "scripts": [ |
| "scripts/base.sh", |
| "scripts/network.sh", |
| "scripts/salt.sh" |
| ] |
| } |
| } |
| }, |
| { |
| "type": "shell", |
| "expect_disconnect": "true", |
| "execute_command": "sh '{{.Path}}'", |
| "script": "scripts/reboot.sh" |
| }, |
| { |
| "environment_vars": [ |
| "HOME=/root", |
| "MCP_VERSION={{ user `mcp_version` }}" |
| ], |
| "type": "shell", |
| "pause_before": "180s", |
| "override": { |
| "qemu": { |
| "scripts": [ |
| "scripts/mirrors.sh", |
| "scripts/security.sh", |
| "scripts/cleanup.sh" |
| ] |
| } |
| } |
| }, |
| { |
| "type": "file", |
| "source": "configs/cloud/cloud.cfg.d/99_tcp.cfg", |
| "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg" |
| }, |
| { |
| "type": "file", |
| "source": "configs/cloud/cloud.cfg", |
| "destination": "/etc/cloud/cloud.cfg" |
| } |
| ], |
| "builders": [ |
| { |
| "type": "qemu", |
| "qemuargs": [ |
| [ |
| "-m", |
| "4096M" |
| ], |
| [ |
| "-smp", |
| "4" |
| ] |
| ], |
| "vm_name": "{{ user `distro` }}-{{ isotime \"200601021504\" }}", |
| "output_directory": "images/{{ user `distro` }}-qemu-{{ isotime \"200601021504\" }}", |
| "format": "qcow2", |
| "accelerator": "kvm", |
| "disk_size": "{{ user `disk_size`}}", |
| "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso", |
| "iso_checksum_type": "md5", |
| "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9", |
| "http_directory": "http", |
| "headless": true, |
| "ssh_username": "{{user `user`}}", |
| "ssh_password": "{{user `password`}}", |
| "shutdown_command": "shutdown -P now", |
| "boot_wait": "2s", |
| "ssh_wait_timeout": "10000s", |
| "boot_command": [ |
| "<enter><wait>", |
| "<f6><esc>", |
| "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| "<bs><bs><bs>", |
| "/install/vmlinuz<wait>", |
| " auto<wait>", |
| " console-setup/ask_detect=false<wait>", |
| " console-setup/layoutcode=us<wait>", |
| " console-setup/modelcode=pc105<wait>", |
| " debconf/frontend=noninteractive<wait>", |
| " debian-installer=en_US<wait>", |
| " fb=false<wait>", |
| " initrd=/install/initrd.gz<wait>", |
| " kbd-chooser/method=us<wait>", |
| " keyboard-configuration/layout=USA<wait>", |
| " keyboard-configuration/variant=USA<wait>", |
| " passwd/root-password={{user `password`}} ", |
| " passwd/root-password-again={{user `password`}} ", |
| " locale=en_US<wait>", |
| " netcfg/get_hostname=ubuntu-1604<wait>", |
| " netcfg/get_domain=changeme<wait>", |
| " noapic<wait>", |
| " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>", |
| " -- <wait>", |
| "<enter><wait>" |
| ] |
| } |
| ] |
| } |