blob: 6d0e1fca5bafdef1c1970d2284d63c49b2d28b01 [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/",
azvyagintsev4053eb22018-03-29 16:21:51 +03008 "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 Broulik0b211672018-04-11 09:35:47 +020010 "image_name": "{{ env `IMAGE_NAME` }}",
azvyagintsev4053eb22018-03-29 16:21:51 +030011 "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"
azvyagintsevd8f85232017-10-02 15:30:28 +030019 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +010020 "provisioners": [
21 {
azvyagintsev5a388552018-04-03 21:25:23 +030022 "type": "shell",
23 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
24 "expect_disconnect": "true",
azvyagintsev4053eb22018-03-29 16:21:51 +030025 "environment_vars": [
26 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
azvyagintsev5a388552018-04-03 21:25:23 +030027 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
28 "SALTSTACK_REPO={{ user `saltstack_repo` }}"
azvyagintsev4053eb22018-03-29 16:21:51 +030029 ],
Filip Pytloun7ae5c752016-01-15 13:48:38 +010030 "override": {
31 "virtualbox-iso": {
32 "scripts": [
33 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020034 "scripts/motd.sh",
Jakub Josef6bcf3862017-05-03 16:16:39 +020035 "scripts/salt.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030036 "scripts/network.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010037 "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",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020047 "scripts/motd.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010048 "scripts/salt.sh",
49 "scripts/vmware.sh",
50 "scripts/security.sh",
51 "scripts/cleanup.sh",
52 "scripts/zerodisk.sh"
53 ]
54 },
azvyagintsevd8f85232017-10-02 15:30:28 +030055 "qemu": {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010056 "scripts": [
57 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020058 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030059 "scripts/salt.sh",
Jakub Josef6bcf3862017-05-03 16:16:39 +020060 "scripts/network.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010061 "scripts/security.sh",
62 "scripts/cleanup.sh",
azvyagintsev4053eb22018-03-29 16:21:51 +030063 "scripts/info.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010064 "scripts/zerodisk.sh"
65 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030066 },
azvyagintsev4053eb22018-03-29 16:21:51 +030067 "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 },
azvyagintsevd8f85232017-10-02 15:30:28 +030078 "docker": {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010079 "scripts": [
80 "scripts/docker.sh",
81 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020082 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030083 "scripts/salt.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010084 "scripts/cleanup.sh"
85 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030086 },
87 "digitalocean": {
88 "scripts": [
89 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020090 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030091 "scripts/salt.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010092 "scripts/security.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030093 "scripts/cleanup.sh"
94 ]
95 }
Filip Pytloun7ae5c752016-01-15 13:48:38 +010096 }
97 },
98 {
99 "type": "file",
alexz5b795142018-02-13 15:59:28 +0100100 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100101 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
102 },
103 {
104 "type": "file",
alexz5b795142018-02-13 15:59:28 +0100105 "source": "files/etc/cloud/cloud.cfg",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100106 "destination": "/etc/cloud/cloud.cfg"
107 }
108 ],
109 "post-processors": [
110 {
111 "type": "vagrant",
112 "keep_input_artifact": true,
Jiri Broulik0b211672018-04-11 09:35:47 +0200113 "output": "images/{{ user `image_name` }}-{{.Provider}}-{{ isotime \"200601021504\" }}.box",
azvyagintsevd8f85232017-10-02 15:30:28 +0300114 "except": [
115 "digitalocean",
116 "docker"
117 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100118 },
119 {
120 "type": "docker-tag",
Filip Pytlounc2b0ca02016-06-09 16:26:30 +0200121 "repository": "tcpcloud/ubuntu",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100122 "tag": "16.04",
azvyagintsevd8f85232017-10-02 15:30:28 +0300123 "only": [
124 "docker"
125 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100126 },
127 {
128 "type": "docker-save",
Jiri Broulik0b211672018-04-11 09:35:47 +0200129 "path": "images/{{ user `image_name` }}-docker-{{ isotime \"200601021504\" }}.tar",
azvyagintsevd8f85232017-10-02 15:30:28 +0300130 "only": [
131 "docker"
132 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100133 }
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 Pytloun451bc982017-03-13 16:21:24 +0100166 "output_directory": "images/{{ user `distro` }}-vbox-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100167 "guest_os_type": "Ubuntu_64",
168 "http_directory": "http",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200169 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100170 "iso_checksum_type": "md5",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200171 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100172 "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": [
azvyagintsevd8f85232017-10-02 15:30:28 +0300179 [
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 Pytloun7ae5c752016-01-15 13:48:38 +0100209 ]
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 Broulik0b211672018-04-11 09:35:47 +0200242 "vmdk_name": "{{ user `image_name`}}",
Filip Pytloun451bc982017-03-13 16:21:24 +0100243 "output_directory": "images/{{ user `distro` }}-vmware-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100244 "guest_os_type": "linux",
245 "http_directory": "http",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200246 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100247 "iso_checksum_type": "md5",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200248 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100249 "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 {
azvyagintsev4053eb22018-03-29 16:21:51 +0300261 "type": "docker",
262 "image": "ubuntu:16.04",
263 "commit": true
264 },
265 {
266 "type": "digitalocean",
267 "api_token": "{{user `do_api_token`}}",
Jiri Broulik0b211672018-04-11 09:35:47 +0200268 "image": "{{user `image_name`}}",
269 "snapshot_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
azvyagintsev4053eb22018-03-29 16:21:51 +0300270 "region": "ams2",
271 "size": "1gb"
272 },
273 {
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100274 "type": "qemu",
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100275 "qemuargs": [
alexz5b795142018-02-13 15:59:28 +0100276 [ "-m", "1024M" ],
277 [ "-fda", "config-drive/cloudata.iso" ]
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100278 ],
azvyagintsev4053eb22018-03-29 16:21:51 +0300279 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
280 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100281 "format": "qcow2",
Richard Felkla5a44262018-03-12 15:11:32 +0100282 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
alexz5b795142018-02-13 15:59:28 +0100283 "iso_checksum_type": "md5",
alexz8c4cfc72018-03-23 13:56:10 +0100284 "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 +0100285 "disk_image": true,
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100286 "accelerator": "kvm",
287 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100288 "headless": true,
289 "ssh_username": "{{user `user`}}",
290 "ssh_password": "{{user `password`}}",
291 "shutdown_command": "shutdown -P now",
292 "boot_wait": "2s",
alexz5b795142018-02-13 15:59:28 +0100293 "ssh_wait_timeout": "360s"
azvyagintsevd8f85232017-10-02 15:30:28 +0300294 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100295 {
azvyagintsev4053eb22018-03-29 16:21:51 +0300296 "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 Pytloun7ae5c752016-01-15 13:48:38 +0100311 }
312 ]
alexz5b795142018-02-13 15:59:28 +0100313}