Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 1 | { |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 2 | "variables": { |
| 3 | "user": "root", |
| 4 | "password": "ho5uo7Uome5d", |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 5 | "distro": "ubuntu-16-04-x64", |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 6 | "disk_size": "8000", |
azvyagintsev | 5a38855 | 2018-04-03 21:25:23 +0300 | [diff] [blame] | 7 | "ubuntu_baseurl": "https://mirror.mirantis.com/proposed/ubuntu/", |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 8 | "saltstack_repo": "deb [arch=amd64] https://mirror.mirantis.com/proposed/saltstack-2016.3/xenial/ xenial main", |
| 9 | "do_api_token": "{{ env `DO_API_TOKEN` }}", |
Jiri Broulik | 0b21167 | 2018-04-11 09:35:47 +0200 | [diff] [blame^] | 10 | "image_name": "{{ env `IMAGE_NAME` }}", |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 11 | "os_username": "{{ env `OS_USERNAME` }}", |
| 12 | "os_password": "{{ env `OS_PASSWORD` }}", |
| 13 | "os_image": "7451fac0-0ce5-4d30-ae36-cd9a90e7948e", |
| 14 | "os_endpoint": "https://cloud-cz.bud.mirantis.net:5000/v2.0", |
| 15 | "os_zone": "mcp-mk", |
| 16 | "os_floating_ip_pool": "public", |
| 17 | "os_tenant": "26e4dd19485249608ee3685f254f3909", |
| 18 | "os_network": "772f8ca6-1f4a-4535-99d0-880d6ead9a82" |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 19 | }, |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 20 | "provisioners": [ |
| 21 | { |
azvyagintsev | 5a38855 | 2018-04-03 21:25:23 +0300 | [diff] [blame] | 22 | "type": "shell", |
| 23 | "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", |
| 24 | "expect_disconnect": "true", |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 25 | "environment_vars": [ |
| 26 | "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}", |
azvyagintsev | 5a38855 | 2018-04-03 21:25:23 +0300 | [diff] [blame] | 27 | "SALTSTACK_GPG={{ user `saltstack_gpg` }}", |
| 28 | "SALTSTACK_REPO={{ user `saltstack_repo` }}" |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 29 | ], |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 30 | "override": { |
| 31 | "virtualbox-iso": { |
| 32 | "scripts": [ |
| 33 | "scripts/base.sh", |
azvyagintsev | c0d1b8a | 2018-03-22 19:05:03 +0200 | [diff] [blame] | 34 | "scripts/motd.sh", |
Jakub Josef | 6bcf386 | 2017-05-03 16:16:39 +0200 | [diff] [blame] | 35 | "scripts/salt.sh", |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 36 | "scripts/network.sh", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 37 | "scripts/vagrant.sh", |
| 38 | "scripts/virtualbox.sh", |
| 39 | "scripts/security.sh", |
| 40 | "scripts/cleanup.sh", |
| 41 | "scripts/zerodisk.sh" |
| 42 | ] |
| 43 | }, |
| 44 | "vmware-iso": { |
| 45 | "scripts": [ |
| 46 | "scripts/base.sh", |
azvyagintsev | c0d1b8a | 2018-03-22 19:05:03 +0200 | [diff] [blame] | 47 | "scripts/motd.sh", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 48 | "scripts/salt.sh", |
| 49 | "scripts/vmware.sh", |
| 50 | "scripts/security.sh", |
| 51 | "scripts/cleanup.sh", |
| 52 | "scripts/zerodisk.sh" |
| 53 | ] |
| 54 | }, |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 55 | "qemu": { |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 56 | "scripts": [ |
| 57 | "scripts/base.sh", |
azvyagintsev | c0d1b8a | 2018-03-22 19:05:03 +0200 | [diff] [blame] | 58 | "scripts/motd.sh", |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 59 | "scripts/salt.sh", |
Jakub Josef | 6bcf386 | 2017-05-03 16:16:39 +0200 | [diff] [blame] | 60 | "scripts/network.sh", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 61 | "scripts/security.sh", |
| 62 | "scripts/cleanup.sh", |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 63 | "scripts/info.sh", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 64 | "scripts/zerodisk.sh" |
| 65 | ] |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 66 | }, |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 67 | "openstack": { |
| 68 | "scripts": [ |
| 69 | "scripts/base.sh", |
| 70 | "scripts/motd.sh", |
| 71 | "scripts/salt.sh", |
| 72 | "scripts/network.sh", |
| 73 | "scripts/security.sh", |
| 74 | "scripts/cleanup.sh", |
| 75 | "scripts/info.sh" |
| 76 | ] |
| 77 | }, |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 78 | "docker": { |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 79 | "scripts": [ |
| 80 | "scripts/docker.sh", |
| 81 | "scripts/base.sh", |
azvyagintsev | c0d1b8a | 2018-03-22 19:05:03 +0200 | [diff] [blame] | 82 | "scripts/motd.sh", |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 83 | "scripts/salt.sh", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 84 | "scripts/cleanup.sh" |
| 85 | ] |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 86 | }, |
| 87 | "digitalocean": { |
| 88 | "scripts": [ |
| 89 | "scripts/base.sh", |
azvyagintsev | c0d1b8a | 2018-03-22 19:05:03 +0200 | [diff] [blame] | 90 | "scripts/motd.sh", |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 91 | "scripts/salt.sh", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 92 | "scripts/security.sh", |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 93 | "scripts/cleanup.sh" |
| 94 | ] |
| 95 | } |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 96 | } |
| 97 | }, |
| 98 | { |
| 99 | "type": "file", |
alexz | 5b79514 | 2018-02-13 15:59:28 +0100 | [diff] [blame] | 100 | "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 101 | "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg" |
| 102 | }, |
| 103 | { |
| 104 | "type": "file", |
alexz | 5b79514 | 2018-02-13 15:59:28 +0100 | [diff] [blame] | 105 | "source": "files/etc/cloud/cloud.cfg", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 106 | "destination": "/etc/cloud/cloud.cfg" |
| 107 | } |
| 108 | ], |
| 109 | "post-processors": [ |
| 110 | { |
| 111 | "type": "vagrant", |
| 112 | "keep_input_artifact": true, |
Jiri Broulik | 0b21167 | 2018-04-11 09:35:47 +0200 | [diff] [blame^] | 113 | "output": "images/{{ user `image_name` }}-{{.Provider}}-{{ isotime \"200601021504\" }}.box", |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 114 | "except": [ |
| 115 | "digitalocean", |
| 116 | "docker" |
| 117 | ] |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 118 | }, |
| 119 | { |
| 120 | "type": "docker-tag", |
Filip Pytloun | c2b0ca0 | 2016-06-09 16:26:30 +0200 | [diff] [blame] | 121 | "repository": "tcpcloud/ubuntu", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 122 | "tag": "16.04", |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 123 | "only": [ |
| 124 | "docker" |
| 125 | ] |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 126 | }, |
| 127 | { |
| 128 | "type": "docker-save", |
Jiri Broulik | 0b21167 | 2018-04-11 09:35:47 +0200 | [diff] [blame^] | 129 | "path": "images/{{ user `image_name` }}-docker-{{ isotime \"200601021504\" }}.tar", |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 130 | "only": [ |
| 131 | "docker" |
| 132 | ] |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 133 | } |
| 134 | ], |
| 135 | "builders": [ |
| 136 | { |
| 137 | "type": "virtualbox-iso", |
| 138 | "boot_command": [ |
| 139 | "<esc><wait>", |
| 140 | "<esc><wait>", |
| 141 | "<enter><wait>", |
| 142 | "/install/vmlinuz<wait>", |
| 143 | " auto<wait>", |
| 144 | " console-setup/ask_detect=false<wait>", |
| 145 | " console-setup/layoutcode=us<wait>", |
| 146 | " console-setup/modelcode=pc105<wait>", |
| 147 | " debconf/frontend=noninteractive<wait>", |
| 148 | " debian-installer=en_US<wait>", |
| 149 | " fb=false<wait>", |
| 150 | " initrd=/install/initrd.gz<wait>", |
| 151 | " kbd-chooser/method=us<wait>", |
| 152 | " keyboard-configuration/layout=USA<wait>", |
| 153 | " keyboard-configuration/variant=USA<wait>", |
| 154 | " passwd/root-password={{user `password`}} ", |
| 155 | " passwd/root-password-again={{user `password`}} ", |
| 156 | " locale=en_US<wait>", |
| 157 | " netcfg/get_hostname=ubuntu-1604<wait>", |
| 158 | " netcfg/get_domain=cloudlab.cz<wait>", |
| 159 | " noapic<wait>", |
| 160 | " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>", |
| 161 | " -- <wait>", |
| 162 | "<enter><wait>" |
| 163 | ], |
| 164 | "boot_wait": "5s", |
| 165 | "disk_size": "{{ user `disk_size`}}", |
Filip Pytloun | 451bc98 | 2017-03-13 16:21:24 +0100 | [diff] [blame] | 166 | "output_directory": "images/{{ user `distro` }}-vbox-{{ isotime \"200601021504\" }}", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 167 | "guest_os_type": "Ubuntu_64", |
| 168 | "http_directory": "http", |
Jakub Josef | a59d0fb | 2017-09-04 13:26:15 +0200 | [diff] [blame] | 169 | "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 170 | "iso_checksum_type": "md5", |
Jakub Josef | a59d0fb | 2017-09-04 13:26:15 +0200 | [diff] [blame] | 171 | "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 172 | "ssh_username": "{{user `user`}}", |
| 173 | "ssh_password": "{{user `password`}}", |
| 174 | "ssh_port": 22, |
| 175 | "ssh_wait_timeout": "10000s", |
| 176 | "shutdown_command": "shutdown -P now", |
| 177 | "headless": true, |
| 178 | "vboxmanage": [ |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 179 | [ |
| 180 | "modifyvm", |
| 181 | "{{.Name}}", |
| 182 | "--memory", |
| 183 | "1024" |
| 184 | ], |
| 185 | [ |
| 186 | "modifyvm", |
| 187 | "{{.Name}}", |
| 188 | "--cpus", |
| 189 | "2" |
| 190 | ], |
| 191 | [ |
| 192 | "modifyvm", |
| 193 | "{{.Name}}", |
| 194 | "--vrde", |
| 195 | "on" |
| 196 | ], |
| 197 | [ |
| 198 | "modifyvm", |
| 199 | "{{.Name}}", |
| 200 | "--vrdeport", |
| 201 | "5000-5050" |
| 202 | ], |
| 203 | [ |
| 204 | "modifyvm", |
| 205 | "{{.Name}}", |
| 206 | "--vrdeaddress", |
| 207 | "127.0.0.1" |
| 208 | ] |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 209 | ] |
| 210 | }, |
| 211 | { |
| 212 | "type": "vmware-iso", |
| 213 | "boot_command": [ |
| 214 | "<esc><wait>", |
| 215 | "<esc><wait>", |
| 216 | "<enter><wait>", |
| 217 | "/install/vmlinuz<wait>", |
| 218 | " auto<wait>", |
| 219 | " console-setup/ask_detect=false<wait>", |
| 220 | " console-setup/layoutcode=us<wait>", |
| 221 | " console-setup/modelcode=pc105<wait>", |
| 222 | " debconf/frontend=noninteractive<wait>", |
| 223 | " debian-installer=en_US<wait>", |
| 224 | " fb=false<wait>", |
| 225 | " initrd=/install/initrd.gz<wait>", |
| 226 | " kbd-chooser/method=us<wait>", |
| 227 | " keyboard-configuration/layout=USA<wait>", |
| 228 | " keyboard-configuration/variant=USA<wait>", |
| 229 | " passwd/root-password={{user `password`}} ", |
| 230 | " passwd/root-password-again={{user `password`}} ", |
| 231 | " locale=en_US<wait>", |
| 232 | " netcfg/get_hostname=ubuntu-1604<wait>", |
| 233 | " netcfg/get_domain=changeme<wait>", |
| 234 | " noapic<wait>", |
| 235 | " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>", |
| 236 | " -- <wait>", |
| 237 | "<enter><wait>" |
| 238 | ], |
| 239 | "boot_wait": "5s", |
| 240 | "disk_size": "{{ user `disk_size`}}", |
| 241 | "disk_type_id": 4, |
Jiri Broulik | 0b21167 | 2018-04-11 09:35:47 +0200 | [diff] [blame^] | 242 | "vmdk_name": "{{ user `image_name`}}", |
Filip Pytloun | 451bc98 | 2017-03-13 16:21:24 +0100 | [diff] [blame] | 243 | "output_directory": "images/{{ user `distro` }}-vmware-{{ isotime \"200601021504\" }}", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 244 | "guest_os_type": "linux", |
| 245 | "http_directory": "http", |
Jakub Josef | d65a5fb | 2017-09-04 16:03:17 +0200 | [diff] [blame] | 246 | "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 247 | "iso_checksum_type": "md5", |
Jakub Josef | d65a5fb | 2017-09-04 16:03:17 +0200 | [diff] [blame] | 248 | "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 249 | "ssh_username": "{{user `user`}}", |
| 250 | "ssh_password": "{{user `password`}}", |
| 251 | "ssh_port": 22, |
| 252 | "ssh_wait_timeout": "10000s", |
| 253 | "shutdown_command": "shutdown -P now", |
| 254 | "vmx_data": { |
| 255 | "memsize": "1024", |
| 256 | "numvcpus": "1", |
| 257 | "cpuid.coresPerSocket": "1" |
| 258 | } |
| 259 | }, |
| 260 | { |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 261 | "type": "docker", |
| 262 | "image": "ubuntu:16.04", |
| 263 | "commit": true |
| 264 | }, |
| 265 | { |
| 266 | "type": "digitalocean", |
| 267 | "api_token": "{{user `do_api_token`}}", |
Jiri Broulik | 0b21167 | 2018-04-11 09:35:47 +0200 | [diff] [blame^] | 268 | "image": "{{user `image_name`}}", |
| 269 | "snapshot_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}", |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 270 | "region": "ams2", |
| 271 | "size": "1gb" |
| 272 | }, |
| 273 | { |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 274 | "type": "qemu", |
Filip Pytloun | 56cf9e3 | 2016-02-19 09:56:08 +0100 | [diff] [blame] | 275 | "qemuargs": [ |
alexz | 5b79514 | 2018-02-13 15:59:28 +0100 | [diff] [blame] | 276 | [ "-m", "1024M" ], |
| 277 | [ "-fda", "config-drive/cloudata.iso" ] |
Filip Pytloun | 56cf9e3 | 2016-02-19 09:56:08 +0100 | [diff] [blame] | 278 | ], |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 279 | "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}", |
| 280 | "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 281 | "format": "qcow2", |
Richard Felkl | a5a4426 | 2018-03-12 15:11:32 +0100 | [diff] [blame] | 282 | "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642", |
alexz | 5b79514 | 2018-02-13 15:59:28 +0100 | [diff] [blame] | 283 | "iso_checksum_type": "md5", |
alexz | 8c4cfc7 | 2018-03-23 13:56:10 +0100 | [diff] [blame] | 284 | "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img", |
alexz | 5b79514 | 2018-02-13 15:59:28 +0100 | [diff] [blame] | 285 | "disk_image": true, |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 286 | "accelerator": "kvm", |
| 287 | "disk_size": "{{ user `disk_size`}}", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 288 | "headless": true, |
| 289 | "ssh_username": "{{user `user`}}", |
| 290 | "ssh_password": "{{user `password`}}", |
| 291 | "shutdown_command": "shutdown -P now", |
| 292 | "boot_wait": "2s", |
alexz | 5b79514 | 2018-02-13 15:59:28 +0100 | [diff] [blame] | 293 | "ssh_wait_timeout": "360s" |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 294 | }, |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 295 | { |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 296 | "type": "openstack", |
| 297 | "ssh_username": "{{user `user`}}", |
| 298 | "ssh_password": "{{user `password`}}", |
| 299 | "image_name": "{{user `image_name`}}", |
| 300 | "floating_ip_pool": "{{user `os_floating_ip_pool`}}", |
| 301 | "reuse_ips": "true", |
| 302 | "source_image": "{{ user `os_image` }}", |
| 303 | "flavor": "{{ user `os_flavor` }}", |
| 304 | "user_data_file": "config-drive/user-data.yaml", |
| 305 | "tenant_id": "{{ user `os_tenant` }}", |
| 306 | "networks": ["{{ user `os_network` }}"], |
| 307 | "availability_zone": "{{user `os_zone`}}", |
| 308 | "identity_endpoint": "{{user `os_endpoint`}}", |
| 309 | "username": "{{user `os_username`}}", |
| 310 | "password": "{{user `os_password`}}" |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 311 | } |
| 312 | ] |
alexz | 5b79514 | 2018-02-13 15:59:28 +0100 | [diff] [blame] | 313 | } |