blob: 81c05802b38e59ab21cba0c18f786aaff89beabc [file] [log] [blame]
jan kaufmana519d7b2015-03-04 00:51:47 +01001{
2 "variables": {
Filip Pytloun896f37b2015-06-25 18:35:42 +02003 "user": "root",
4 "password": "ho5uo7Uome5d",
jan kaufmana519d7b2015-03-04 00:51:47 +01005 "do_api_token": "{{ env `DO_API_TOKEN` }}",
6 "distro": "ubuntu-14-04-x64",
Filip Pytloun39832362015-06-25 18:05:47 +02007 "disk_size": "8000"
jan kaufmana519d7b2015-03-04 00:51:47 +01008 },
9
10 "provisioners": [
11 {
12 "type": "shell",
13 "execute_command": "echo '{{user `user`}}' |sudo -S sh '{{.Path}}'",
14 "override": {
15 "virtualbox-iso": {
16 "scripts": [
17 "scripts/base.sh",
18 "scripts/salt.sh",
19 "scripts/vagrant.sh",
20 "scripts/virtualbox.sh",
Filip Pytloun896f37b2015-06-25 18:35:42 +020021 "scripts/security.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010022 "scripts/cleanup.sh",
23 "scripts/zerodisk.sh"
24 ]
25 },
26 "vmware-iso": {
27 "scripts": [
28 "scripts/base.sh",
jan kaufmandfc08f02015-04-29 20:17:55 +020029 "scripts/salt.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010030 "scripts/vmware.sh",
Filip Pytloun896f37b2015-06-25 18:35:42 +020031 "scripts/security.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010032 "scripts/cleanup.sh",
33 "scripts/zerodisk.sh"
34 ]
35 },
36 "qemu": {
37 "scripts": [
38 "scripts/base.sh",
39 "scripts/salt.sh",
Filip Pytloun896f37b2015-06-25 18:35:42 +020040 "scripts/security.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010041 "scripts/cleanup.sh",
42 "scripts/zerodisk.sh"
43 ]
44 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +020045 "docker": {
46 "scripts": [
47 "scripts/docker.sh",
48 "scripts/base.sh",
49 "scripts/salt.sh",
50 "scripts/cleanup.sh"
51 ]
52 },
jan kaufmana519d7b2015-03-04 00:51:47 +010053 "digitalocean": {
54 "scripts": [
55 "scripts/base.sh",
56 "scripts/salt.sh",
Filip Pytloun896f37b2015-06-25 18:35:42 +020057 "scripts/security.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010058 "scripts/cleanup.sh"
59 ]
60 }
61 }
jan kaufman0fcf1a72015-05-06 10:16:12 +020062 },
63 {
64 "type": "file",
65 "source": "configs/cloud/cloud.cfg.d/99_tcp.cfg",
66 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
Filip Pytloun60411d12015-06-25 21:14:41 +020067 },
68 {
69 "type": "file",
70 "source": "configs/cloud/cloud.cfg",
71 "destination": "/etc/cloud/cloud.cfg"
jan kaufmana519d7b2015-03-04 00:51:47 +010072 }
73 ],
74 "post-processors": [
75 {
76 "type": "vagrant",
77 "keep_input_artifact": true,
78 "except": "digitalocean",
79 "override": {
80 "virtualbox": {
jan kaufmandfc08f02015-04-29 20:17:55 +020081 "output": "images/{{ user `distro` }}-vbox-{{ timestamp }}.box"
jan kaufmana519d7b2015-03-04 00:51:47 +010082 },
83 "vmware": {
jan kaufmandfc08f02015-04-29 20:17:55 +020084 "output": "images/{{ user `distro` }}-vmware-{{ timestamp }}.box"
jan kaufmana519d7b2015-03-04 00:51:47 +010085 },
86 "qemu": {
jan kaufmandfc08f02015-04-29 20:17:55 +020087 "output": "images/{{ user `distro` }}-qemu-{{ timestamp }}.box"
jan kaufmana519d7b2015-03-04 00:51:47 +010088 }
89 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +020090 "except": [ "digitalocean", "docker" ]
91 },
92 {
93 "type": "docker-tag",
94 "repository": "cloudlab/ubuntu",
Filip Pytloun7d733bc2015-07-11 08:34:49 +020095 "tag": "14.04",
96 "only": ["docker"]
Filip Pytloun62c8f832015-07-22 17:40:00 +020097 },
98 {
99 "type": "docker-save",
100 "path": "images/{{ user `distro` }}-docker-{{ timestamp }}.tar",
101 "only": ["docker"]
jan kaufmana519d7b2015-03-04 00:51:47 +0100102 }
103 ],
104 "builders": [
105 {
106 "type": "virtualbox-iso",
107 "boot_command": [
108 "<esc><wait>",
109 "<esc><wait>",
110 "<enter><wait>",
111 "/install/vmlinuz<wait>",
112 " auto<wait>",
113 " console-setup/ask_detect=false<wait>",
114 " console-setup/layoutcode=us<wait>",
115 " console-setup/modelcode=pc105<wait>",
116 " debconf/frontend=noninteractive<wait>",
117 " debian-installer=en_US<wait>",
118 " fb=false<wait>",
119 " initrd=/install/initrd.gz<wait>",
120 " kbd-chooser/method=us<wait>",
121 " keyboard-configuration/layout=USA<wait>",
122 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200123 " passwd/root-password={{user `password`}} ",
124 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100125 " locale=en_US<wait>",
126 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufmandfc08f02015-04-29 20:17:55 +0200127 " netcfg/get_domain=cloudlab.cz<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100128 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200129 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100130 " -- <wait>",
131 "<enter><wait>"
132 ],
133 "boot_wait": "5s",
134 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200135 "output_directory": "images/{{ user `distro` }}-vbox-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100136 "guest_os_type": "Ubuntu_64",
137 "http_directory": "http",
jan kaufmandfc08f02015-04-29 20:17:55 +0200138 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100139 "iso_checksum_type": "md5",
Filip Pytloun3f1b1102015-07-22 16:10:19 +0200140 "iso_url": "http://releases.ubuntu.mirror.dkm.cz/releases/14.04/ubuntu-14.04.2-server-amd64.iso",
jan kaufmana519d7b2015-03-04 00:51:47 +0100141 "ssh_username": "{{user `user`}}",
142 "ssh_password": "{{user `password`}}",
143 "ssh_port": 22,
144 "ssh_wait_timeout": "10000s",
145 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
146 "vboxmanage": [
147 [ "modifyvm", "{{.Name}}", "--memory", "1024" ],
148 [ "modifyvm", "{{.Name}}", "--cpus", "2" ]
149 ]
150 },
151 {
152 "type": "vmware-iso",
153 "boot_command": [
154 "<esc><wait>",
155 "<esc><wait>",
156 "<enter><wait>",
157 "/install/vmlinuz<wait>",
158 " auto<wait>",
159 " console-setup/ask_detect=false<wait>",
160 " console-setup/layoutcode=us<wait>",
161 " console-setup/modelcode=pc105<wait>",
162 " debconf/frontend=noninteractive<wait>",
163 " debian-installer=en_US<wait>",
164 " fb=false<wait>",
165 " initrd=/install/initrd.gz<wait>",
166 " kbd-chooser/method=us<wait>",
167 " keyboard-configuration/layout=USA<wait>",
168 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200169 " passwd/root-password={{user `password`}} ",
170 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100171 " locale=en_US<wait>",
172 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100173 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100174 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200175 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100176 " -- <wait>",
177 "<enter><wait>"
178 ],
179 "boot_wait": "5s",
180 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200181 "disk_type_id": 4,
182 "vmdk_name": "{{ user `distro`}}",
183 "output_directory": "images/{{ user `distro` }}-vmware-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100184 "guest_os_type": "linux",
185 "http_directory": "http",
jan kaufmandfc08f02015-04-29 20:17:55 +0200186 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100187 "iso_checksum_type": "md5",
Filip Pytloun3f1b1102015-07-22 16:10:19 +0200188 "iso_url": "http://releases.ubuntu.mirror.dkm.cz/releases/14.04/ubuntu-14.04.2-server-amd64.iso",
jan kaufmana519d7b2015-03-04 00:51:47 +0100189 "ssh_username": "{{user `user`}}",
190 "ssh_password": "{{user `password`}}",
191 "ssh_port": 22,
192 "ssh_wait_timeout": "10000s",
193 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
194 "vmx_data": {
jan kaufmandfc08f02015-04-29 20:17:55 +0200195 "memsize": "1024",
jan kaufmana519d7b2015-03-04 00:51:47 +0100196 "numvcpus": "1",
197 "cpuid.coresPerSocket": "1"
198 }
199 },
200 {
201 "type": "qemu",
202 "vm_name": "{{ user `distro` }}-{{ timestamp }}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200203 "output_directory": "images/{{ user `distro` }}-qemu-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100204 "format": "qcow2",
205 "accelerator": "kvm",
206 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun3f1b1102015-07-22 16:10:19 +0200207 "iso_url": "http://releases.ubuntu.mirror.dkm.cz/releases/14.04/ubuntu-14.04.2-server-amd64.iso",
jan kaufmana519d7b2015-03-04 00:51:47 +0100208 "iso_checksum_type": "md5",
jan kaufmandfc08f02015-04-29 20:17:55 +0200209 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100210 "http_directory": "http",
jan kaufman64b9f972015-03-11 11:31:28 +0100211 "headless": true,
jan kaufmana519d7b2015-03-04 00:51:47 +0100212 "ssh_username": "{{user `user`}}",
213 "ssh_password": "{{user `password`}}",
214 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
215 "boot_wait": "2s",
Filip Pytloun39832362015-06-25 18:05:47 +0200216 "ssh_wait_timeout": "10000s",
jan kaufmana519d7b2015-03-04 00:51:47 +0100217 "boot_command": [
218 "<esc><wait>",
219 "<esc><wait>",
220 "<enter><wait>",
221 "/install/vmlinuz<wait>",
222 " auto<wait>",
223 " console-setup/ask_detect=false<wait>",
224 " console-setup/layoutcode=us<wait>",
225 " console-setup/modelcode=pc105<wait>",
226 " debconf/frontend=noninteractive<wait>",
227 " debian-installer=en_US<wait>",
228 " fb=false<wait>",
229 " initrd=/install/initrd.gz<wait>",
230 " kbd-chooser/method=us<wait>",
231 " keyboard-configuration/layout=USA<wait>",
232 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200233 " passwd/root-password={{user `password`}} ",
234 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100235 " locale=en_US<wait>",
236 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100237 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100238 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200239 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100240 " -- <wait>",
241 "<enter><wait>"
242 ]
243 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200244 {
245 "type": "docker",
246 "image": "ubuntu:14.04",
247 "commit": true
Filip Pytloun896f37b2015-06-25 18:35:42 +0200248 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200249 {
jan kaufmana519d7b2015-03-04 00:51:47 +0100250 "type": "digitalocean",
251 "api_token": "{{user `do_api_token`}}",
252 "image": "{{user `distro`}}",
253 "snapshot_name": "{{ user `distro` }}-{{ timestamp }}",
254 "region" : "ams2",
255 "size" : "1gb"
256 }
257 ]
258}