blob: 467b143f987a012052cb7e578736b2afdb068f97 [file] [log] [blame]
Filip Pytloun7ae5c752016-01-15 13:48:38 +01001{
azvyagintsevd8f85232017-10-02 15:30:28 +03002 "variables": {
3 "user": "root",
4 "password": "ho5uo7Uome5d",
azvyagintsevd8f85232017-10-02 15:30:28 +03005 "distro": "ubuntu-16-04-x64",
azvyagintsev4053eb22018-03-29 16:21:51 +03006 "disk_size": "8000",
azvyagintsev5a388552018-04-03 21:25:23 +03007 "ubuntu_baseurl": "https://mirror.mirantis.com/proposed/ubuntu/",
Jiri Broulik2ad150e2018-04-19 17:48:55 +02008 "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
9 "saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
azvyagintsev4053eb22018-03-29 16:21:51 +030010 "do_api_token": "{{ env `DO_API_TOKEN` }}",
Jiri Broulik0b211672018-04-11 09:35:47 +020011 "image_name": "{{ env `IMAGE_NAME` }}",
azvyagintsev4053eb22018-03-29 16:21:51 +030012 "os_username": "{{ env `OS_USERNAME` }}",
13 "os_password": "{{ env `OS_PASSWORD` }}",
14 "os_image": "7451fac0-0ce5-4d30-ae36-cd9a90e7948e",
15 "os_endpoint": "https://cloud-cz.bud.mirantis.net:5000/v2.0",
16 "os_zone": "mcp-mk",
17 "os_floating_ip_pool": "public",
18 "os_tenant": "26e4dd19485249608ee3685f254f3909",
19 "os_network": "772f8ca6-1f4a-4535-99d0-880d6ead9a82"
azvyagintsevd8f85232017-10-02 15:30:28 +030020 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +010021 "provisioners": [
22 {
azvyagintsev5a388552018-04-03 21:25:23 +030023 "type": "shell",
24 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
25 "expect_disconnect": "true",
azvyagintsev4053eb22018-03-29 16:21:51 +030026 "environment_vars": [
27 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
azvyagintsev5a388552018-04-03 21:25:23 +030028 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
29 "SALTSTACK_REPO={{ user `saltstack_repo` }}"
azvyagintsev4053eb22018-03-29 16:21:51 +030030 ],
Filip Pytloun7ae5c752016-01-15 13:48:38 +010031 "override": {
32 "virtualbox-iso": {
33 "scripts": [
34 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020035 "scripts/motd.sh",
Jakub Josef6bcf3862017-05-03 16:16:39 +020036 "scripts/salt.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030037 "scripts/network.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010038 "scripts/vagrant.sh",
39 "scripts/virtualbox.sh",
40 "scripts/security.sh",
41 "scripts/cleanup.sh",
42 "scripts/zerodisk.sh"
43 ]
44 },
45 "vmware-iso": {
46 "scripts": [
47 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020048 "scripts/motd.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010049 "scripts/salt.sh",
50 "scripts/vmware.sh",
51 "scripts/security.sh",
52 "scripts/cleanup.sh",
53 "scripts/zerodisk.sh"
54 ]
55 },
azvyagintsevd8f85232017-10-02 15:30:28 +030056 "qemu": {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010057 "scripts": [
58 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020059 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030060 "scripts/salt.sh",
Jakub Josef6bcf3862017-05-03 16:16:39 +020061 "scripts/network.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010062 "scripts/security.sh",
63 "scripts/cleanup.sh",
azvyagintsev4053eb22018-03-29 16:21:51 +030064 "scripts/info.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010065 "scripts/zerodisk.sh"
66 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030067 },
azvyagintsev4053eb22018-03-29 16:21:51 +030068 "openstack": {
69 "scripts": [
70 "scripts/base.sh",
71 "scripts/motd.sh",
72 "scripts/salt.sh",
73 "scripts/network.sh",
74 "scripts/security.sh",
75 "scripts/cleanup.sh",
76 "scripts/info.sh"
77 ]
78 },
azvyagintsevd8f85232017-10-02 15:30:28 +030079 "docker": {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010080 "scripts": [
81 "scripts/docker.sh",
82 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020083 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030084 "scripts/salt.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010085 "scripts/cleanup.sh"
86 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030087 },
88 "digitalocean": {
89 "scripts": [
90 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020091 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030092 "scripts/salt.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010093 "scripts/security.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030094 "scripts/cleanup.sh"
95 ]
96 }
Filip Pytloun7ae5c752016-01-15 13:48:38 +010097 }
98 },
99 {
100 "type": "file",
alexz5b795142018-02-13 15:59:28 +0100101 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100102 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
103 },
104 {
105 "type": "file",
alexz5b795142018-02-13 15:59:28 +0100106 "source": "files/etc/cloud/cloud.cfg",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100107 "destination": "/etc/cloud/cloud.cfg"
108 }
109 ],
110 "post-processors": [
111 {
112 "type": "vagrant",
113 "keep_input_artifact": true,
Jiri Broulik0b211672018-04-11 09:35:47 +0200114 "output": "images/{{ user `image_name` }}-{{.Provider}}-{{ isotime \"200601021504\" }}.box",
azvyagintsevd8f85232017-10-02 15:30:28 +0300115 "except": [
116 "digitalocean",
117 "docker"
118 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100119 },
120 {
121 "type": "docker-tag",
Filip Pytlounc2b0ca02016-06-09 16:26:30 +0200122 "repository": "tcpcloud/ubuntu",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100123 "tag": "16.04",
azvyagintsevd8f85232017-10-02 15:30:28 +0300124 "only": [
125 "docker"
126 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100127 },
128 {
129 "type": "docker-save",
Jiri Broulik0b211672018-04-11 09:35:47 +0200130 "path": "images/{{ user `image_name` }}-docker-{{ isotime \"200601021504\" }}.tar",
azvyagintsevd8f85232017-10-02 15:30:28 +0300131 "only": [
132 "docker"
133 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100134 }
135 ],
136 "builders": [
137 {
138 "type": "virtualbox-iso",
139 "boot_command": [
140 "<esc><wait>",
141 "<esc><wait>",
142 "<enter><wait>",
143 "/install/vmlinuz<wait>",
144 " auto<wait>",
145 " console-setup/ask_detect=false<wait>",
146 " console-setup/layoutcode=us<wait>",
147 " console-setup/modelcode=pc105<wait>",
148 " debconf/frontend=noninteractive<wait>",
149 " debian-installer=en_US<wait>",
150 " fb=false<wait>",
151 " initrd=/install/initrd.gz<wait>",
152 " kbd-chooser/method=us<wait>",
153 " keyboard-configuration/layout=USA<wait>",
154 " keyboard-configuration/variant=USA<wait>",
155 " passwd/root-password={{user `password`}} ",
156 " passwd/root-password-again={{user `password`}} ",
157 " locale=en_US<wait>",
158 " netcfg/get_hostname=ubuntu-1604<wait>",
159 " netcfg/get_domain=cloudlab.cz<wait>",
160 " noapic<wait>",
161 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
162 " -- <wait>",
163 "<enter><wait>"
164 ],
165 "boot_wait": "5s",
166 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun451bc982017-03-13 16:21:24 +0100167 "output_directory": "images/{{ user `distro` }}-vbox-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100168 "guest_os_type": "Ubuntu_64",
169 "http_directory": "http",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200170 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100171 "iso_checksum_type": "md5",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200172 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100173 "ssh_username": "{{user `user`}}",
174 "ssh_password": "{{user `password`}}",
175 "ssh_port": 22,
176 "ssh_wait_timeout": "10000s",
177 "shutdown_command": "shutdown -P now",
178 "headless": true,
179 "vboxmanage": [
azvyagintsevd8f85232017-10-02 15:30:28 +0300180 [
181 "modifyvm",
182 "{{.Name}}",
183 "--memory",
184 "1024"
185 ],
186 [
187 "modifyvm",
188 "{{.Name}}",
189 "--cpus",
190 "2"
191 ],
192 [
193 "modifyvm",
194 "{{.Name}}",
195 "--vrde",
196 "on"
197 ],
198 [
199 "modifyvm",
200 "{{.Name}}",
201 "--vrdeport",
202 "5000-5050"
203 ],
204 [
205 "modifyvm",
206 "{{.Name}}",
207 "--vrdeaddress",
208 "127.0.0.1"
209 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100210 ]
211 },
212 {
213 "type": "vmware-iso",
214 "boot_command": [
215 "<esc><wait>",
216 "<esc><wait>",
217 "<enter><wait>",
218 "/install/vmlinuz<wait>",
219 " auto<wait>",
220 " console-setup/ask_detect=false<wait>",
221 " console-setup/layoutcode=us<wait>",
222 " console-setup/modelcode=pc105<wait>",
223 " debconf/frontend=noninteractive<wait>",
224 " debian-installer=en_US<wait>",
225 " fb=false<wait>",
226 " initrd=/install/initrd.gz<wait>",
227 " kbd-chooser/method=us<wait>",
228 " keyboard-configuration/layout=USA<wait>",
229 " keyboard-configuration/variant=USA<wait>",
230 " passwd/root-password={{user `password`}} ",
231 " passwd/root-password-again={{user `password`}} ",
232 " locale=en_US<wait>",
233 " netcfg/get_hostname=ubuntu-1604<wait>",
234 " netcfg/get_domain=changeme<wait>",
235 " noapic<wait>",
236 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
237 " -- <wait>",
238 "<enter><wait>"
239 ],
240 "boot_wait": "5s",
241 "disk_size": "{{ user `disk_size`}}",
242 "disk_type_id": 4,
Jiri Broulik0b211672018-04-11 09:35:47 +0200243 "vmdk_name": "{{ user `image_name`}}",
Filip Pytloun451bc982017-03-13 16:21:24 +0100244 "output_directory": "images/{{ user `distro` }}-vmware-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100245 "guest_os_type": "linux",
246 "http_directory": "http",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200247 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100248 "iso_checksum_type": "md5",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200249 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100250 "ssh_username": "{{user `user`}}",
251 "ssh_password": "{{user `password`}}",
252 "ssh_port": 22,
253 "ssh_wait_timeout": "10000s",
254 "shutdown_command": "shutdown -P now",
255 "vmx_data": {
256 "memsize": "1024",
257 "numvcpus": "1",
258 "cpuid.coresPerSocket": "1"
259 }
260 },
261 {
azvyagintsev4053eb22018-03-29 16:21:51 +0300262 "type": "docker",
263 "image": "ubuntu:16.04",
264 "commit": true
265 },
266 {
267 "type": "digitalocean",
268 "api_token": "{{user `do_api_token`}}",
Jiri Broulik0b211672018-04-11 09:35:47 +0200269 "image": "{{user `image_name`}}",
270 "snapshot_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
azvyagintsev4053eb22018-03-29 16:21:51 +0300271 "region": "ams2",
272 "size": "1gb"
273 },
274 {
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100275 "type": "qemu",
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100276 "qemuargs": [
alexz5b795142018-02-13 15:59:28 +0100277 [ "-m", "1024M" ],
278 [ "-fda", "config-drive/cloudata.iso" ]
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100279 ],
azvyagintsev4053eb22018-03-29 16:21:51 +0300280 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
281 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100282 "format": "qcow2",
Richard Felkla5a44262018-03-12 15:11:32 +0100283 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
alexz5b795142018-02-13 15:59:28 +0100284 "iso_checksum_type": "md5",
alexz8c4cfc72018-03-23 13:56:10 +0100285 "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img",
alexz5b795142018-02-13 15:59:28 +0100286 "disk_image": true,
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100287 "accelerator": "kvm",
288 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100289 "headless": true,
290 "ssh_username": "{{user `user`}}",
291 "ssh_password": "{{user `password`}}",
292 "shutdown_command": "shutdown -P now",
293 "boot_wait": "2s",
alexz5b795142018-02-13 15:59:28 +0100294 "ssh_wait_timeout": "360s"
azvyagintsevd8f85232017-10-02 15:30:28 +0300295 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100296 {
azvyagintsev4053eb22018-03-29 16:21:51 +0300297 "type": "openstack",
298 "ssh_username": "{{user `user`}}",
299 "ssh_password": "{{user `password`}}",
300 "image_name": "{{user `image_name`}}",
301 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
302 "reuse_ips": "true",
303 "source_image": "{{ user `os_image` }}",
304 "flavor": "{{ user `os_flavor` }}",
305 "user_data_file": "config-drive/user-data.yaml",
306 "tenant_id": "{{ user `os_tenant` }}",
307 "networks": ["{{ user `os_network` }}"],
308 "availability_zone": "{{user `os_zone`}}",
309 "identity_endpoint": "{{user `os_endpoint`}}",
310 "username": "{{user `os_username`}}",
311 "password": "{{user `os_password`}}"
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100312 }
313 ]
alexz5b795142018-02-13 15:59:28 +0100314}