Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 1 | { |
| 2 | "variables": { |
| 3 | "user": "root", |
| 4 | "password": "ho5uo7Uome5d", |
| 5 | "do_api_token": "{{ env `DO_API_TOKEN` }}", |
| 6 | "distro": "mcp-mirror-image", |
| 7 | "disk_size": "150000", |
| 8 | "cluster_model": "{{ env `CLUSTER_MODEL` }}", |
| 9 | "cluster_model_ref": "{{ env `CLUSTER_MODEL_REF` }}", |
| 10 | "cluster_name": "{{ env `CLUSTER_NAME` }}", |
| 11 | "formula_version": "{{ env `FORMULA_VERSION` }}", |
| 12 | "mcp_version": "{{ env `MCP_VERSION` }}" |
| 13 | }, |
| 14 | "provisioners": [ |
| 15 | { |
| 16 | "environment_vars": [ |
| 17 | "CLUSTER_MODEL={{ user `cluster_model` }}", |
| 18 | "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}", |
| 19 | "CLUSTER_NAME={{ user `cluster_name` }}", |
| 20 | "FORMULA_VERSION={{ user `formula_version` }}" |
| 21 | ], |
| 22 | "type": "shell", |
| 23 | "expect_disconnect": "true", |
| 24 | "override": { |
| 25 | "qemu": { |
| 26 | "scripts": [ |
| 27 | "scripts/base.sh", |
| 28 | "scripts/network.sh", |
| 29 | "scripts/salt.sh" |
| 30 | ] |
| 31 | } |
| 32 | } |
| 33 | }, |
| 34 | { |
| 35 | "type": "shell", |
| 36 | "expect_disconnect": "true", |
| 37 | "execute_command": "sh '{{.Path}}'", |
| 38 | "script": "scripts/reboot.sh" |
| 39 | }, |
| 40 | { |
| 41 | "environment_vars": [ |
| 42 | "HOME=/root", |
| 43 | "MCP_VERSION={{ user `mcp_version` }}" |
| 44 | ], |
| 45 | "type": "shell", |
| 46 | "pause_before": "180s", |
| 47 | "override": { |
| 48 | "qemu": { |
| 49 | "scripts": [ |
| 50 | "scripts/mirrors.sh", |
| 51 | "scripts/security.sh", |
| 52 | "scripts/cleanup.sh" |
| 53 | ] |
| 54 | } |
| 55 | } |
| 56 | }, |
| 57 | { |
| 58 | "type": "file", |
| 59 | "source": "configs/cloud/cloud.cfg.d/99_tcp.cfg", |
| 60 | "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg" |
| 61 | }, |
| 62 | { |
| 63 | "type": "file", |
| 64 | "source": "configs/cloud/cloud.cfg", |
| 65 | "destination": "/etc/cloud/cloud.cfg" |
| 66 | } |
| 67 | ], |
| 68 | "builders": [ |
| 69 | { |
| 70 | "type": "qemu", |
| 71 | "qemuargs": [ |
| 72 | [ |
| 73 | "-m", |
| 74 | "4096M" |
| 75 | ], |
| 76 | [ |
| 77 | "-smp", |
| 78 | "4" |
| 79 | ] |
| 80 | ], |
| 81 | "vm_name": "{{ user `distro` }}-{{ isotime \"200601021504\" }}", |
| 82 | "output_directory": "images/{{ user `distro` }}-qemu-{{ isotime \"200601021504\" }}", |
| 83 | "format": "qcow2", |
| 84 | "accelerator": "kvm", |
| 85 | "disk_size": "{{ user `disk_size`}}", |
| 86 | "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso", |
| 87 | "iso_checksum_type": "md5", |
| 88 | "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9", |
| 89 | "http_directory": "http", |
| 90 | "headless": true, |
| 91 | "ssh_username": "{{user `user`}}", |
| 92 | "ssh_password": "{{user `password`}}", |
| 93 | "shutdown_command": "shutdown -P now", |
| 94 | "boot_wait": "2s", |
| 95 | "ssh_wait_timeout": "10000s", |
| 96 | "boot_command": [ |
| 97 | "<enter><wait>", |
| 98 | "<f6><esc>", |
| 99 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 100 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 101 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 102 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 103 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 104 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 105 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 106 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 107 | "<bs><bs><bs>", |
| 108 | "/install/vmlinuz<wait>", |
| 109 | " auto<wait>", |
| 110 | " console-setup/ask_detect=false<wait>", |
| 111 | " console-setup/layoutcode=us<wait>", |
| 112 | " console-setup/modelcode=pc105<wait>", |
| 113 | " debconf/frontend=noninteractive<wait>", |
| 114 | " debian-installer=en_US<wait>", |
| 115 | " fb=false<wait>", |
| 116 | " initrd=/install/initrd.gz<wait>", |
| 117 | " kbd-chooser/method=us<wait>", |
| 118 | " keyboard-configuration/layout=USA<wait>", |
| 119 | " keyboard-configuration/variant=USA<wait>", |
| 120 | " passwd/root-password={{user `password`}} ", |
| 121 | " passwd/root-password-again={{user `password`}} ", |
| 122 | " locale=en_US<wait>", |
| 123 | " netcfg/get_hostname=ubuntu-1604<wait>", |
| 124 | " netcfg/get_domain=changeme<wait>", |
| 125 | " noapic<wait>", |
| 126 | " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>", |
| 127 | " -- <wait>", |
| 128 | "<enter><wait>" |
| 129 | ] |
| 130 | } |
| 131 | ] |
| 132 | } |