blob: d33a262edacc6768e513933d5e21ea1380034a6e [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"
Filip Pytloun7b48fd22015-06-30 23:34:01 +020088 },
89 "qemu": {
90 "output": "images/{{ user `distro` }}-qemu-{{ timestamp }}.box"
jan kaufmana519d7b2015-03-04 00:51:47 +010091 }
92 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +020093 "except": [ "digitalocean", "docker" ]
94 },
95 {
96 "type": "docker-tag",
97 "repository": "cloudlab/ubuntu",
Filip Pytloun7d733bc2015-07-11 08:34:49 +020098 "tag": "14.04",
99 "only": ["docker"]
jan kaufmana519d7b2015-03-04 00:51:47 +0100100 }
101 ],
102 "builders": [
103 {
104 "type": "virtualbox-iso",
105 "boot_command": [
106 "<esc><wait>",
107 "<esc><wait>",
108 "<enter><wait>",
109 "/install/vmlinuz<wait>",
110 " auto<wait>",
111 " console-setup/ask_detect=false<wait>",
112 " console-setup/layoutcode=us<wait>",
113 " console-setup/modelcode=pc105<wait>",
114 " debconf/frontend=noninteractive<wait>",
115 " debian-installer=en_US<wait>",
116 " fb=false<wait>",
117 " initrd=/install/initrd.gz<wait>",
118 " kbd-chooser/method=us<wait>",
119 " keyboard-configuration/layout=USA<wait>",
120 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200121 " passwd/root-password={{user `password`}} ",
122 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100123 " locale=en_US<wait>",
124 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufmandfc08f02015-04-29 20:17:55 +0200125 " netcfg/get_domain=cloudlab.cz<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100126 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200127 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100128 " -- <wait>",
129 "<enter><wait>"
130 ],
131 "boot_wait": "5s",
132 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200133 "output_directory": "images/{{ user `distro` }}-vbox-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100134 "guest_os_type": "Ubuntu_64",
135 "http_directory": "http",
jan kaufmandfc08f02015-04-29 20:17:55 +0200136 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100137 "iso_checksum_type": "md5",
Filip Pytloun3f1b1102015-07-22 16:10:19 +0200138 "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 +0100139 "ssh_username": "{{user `user`}}",
140 "ssh_password": "{{user `password`}}",
141 "ssh_port": 22,
142 "ssh_wait_timeout": "10000s",
143 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
144 "vboxmanage": [
145 [ "modifyvm", "{{.Name}}", "--memory", "1024" ],
146 [ "modifyvm", "{{.Name}}", "--cpus", "2" ]
147 ]
148 },
149 {
150 "type": "vmware-iso",
151 "boot_command": [
152 "<esc><wait>",
153 "<esc><wait>",
154 "<enter><wait>",
155 "/install/vmlinuz<wait>",
156 " auto<wait>",
157 " console-setup/ask_detect=false<wait>",
158 " console-setup/layoutcode=us<wait>",
159 " console-setup/modelcode=pc105<wait>",
160 " debconf/frontend=noninteractive<wait>",
161 " debian-installer=en_US<wait>",
162 " fb=false<wait>",
163 " initrd=/install/initrd.gz<wait>",
164 " kbd-chooser/method=us<wait>",
165 " keyboard-configuration/layout=USA<wait>",
166 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200167 " passwd/root-password={{user `password`}} ",
168 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100169 " locale=en_US<wait>",
170 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100171 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100172 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200173 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100174 " -- <wait>",
175 "<enter><wait>"
176 ],
177 "boot_wait": "5s",
178 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200179 "disk_type_id": 4,
180 "vmdk_name": "{{ user `distro`}}",
181 "output_directory": "images/{{ user `distro` }}-vmware-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100182 "guest_os_type": "linux",
183 "http_directory": "http",
jan kaufmandfc08f02015-04-29 20:17:55 +0200184 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100185 "iso_checksum_type": "md5",
Filip Pytloun3f1b1102015-07-22 16:10:19 +0200186 "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 +0100187 "ssh_username": "{{user `user`}}",
188 "ssh_password": "{{user `password`}}",
189 "ssh_port": 22,
190 "ssh_wait_timeout": "10000s",
191 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
192 "vmx_data": {
jan kaufmandfc08f02015-04-29 20:17:55 +0200193 "memsize": "1024",
jan kaufmana519d7b2015-03-04 00:51:47 +0100194 "numvcpus": "1",
195 "cpuid.coresPerSocket": "1"
196 }
197 },
198 {
199 "type": "qemu",
200 "vm_name": "{{ user `distro` }}-{{ timestamp }}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200201 "output_directory": "images/{{ user `distro` }}-qemu-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100202 "format": "qcow2",
203 "accelerator": "kvm",
204 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun3f1b1102015-07-22 16:10:19 +0200205 "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 +0100206 "iso_checksum_type": "md5",
jan kaufmandfc08f02015-04-29 20:17:55 +0200207 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100208 "http_directory": "http",
jan kaufman64b9f972015-03-11 11:31:28 +0100209 "headless": true,
jan kaufmana519d7b2015-03-04 00:51:47 +0100210 "ssh_username": "{{user `user`}}",
211 "ssh_password": "{{user `password`}}",
212 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
213 "boot_wait": "2s",
Filip Pytloun39832362015-06-25 18:05:47 +0200214 "ssh_wait_timeout": "10000s",
jan kaufmana519d7b2015-03-04 00:51:47 +0100215 "boot_command": [
216 "<esc><wait>",
217 "<esc><wait>",
218 "<enter><wait>",
219 "/install/vmlinuz<wait>",
220 " auto<wait>",
221 " console-setup/ask_detect=false<wait>",
222 " console-setup/layoutcode=us<wait>",
223 " console-setup/modelcode=pc105<wait>",
224 " debconf/frontend=noninteractive<wait>",
225 " debian-installer=en_US<wait>",
226 " fb=false<wait>",
227 " initrd=/install/initrd.gz<wait>",
228 " kbd-chooser/method=us<wait>",
229 " keyboard-configuration/layout=USA<wait>",
230 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200231 " passwd/root-password={{user `password`}} ",
232 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100233 " locale=en_US<wait>",
234 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100235 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100236 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200237 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100238 " -- <wait>",
239 "<enter><wait>"
240 ]
241 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200242 {
243 "type": "docker",
244 "image": "ubuntu:14.04",
245 "commit": true
Filip Pytloun896f37b2015-06-25 18:35:42 +0200246 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200247 {
jan kaufmana519d7b2015-03-04 00:51:47 +0100248 "type": "digitalocean",
249 "api_token": "{{user `do_api_token`}}",
250 "image": "{{user `distro`}}",
251 "snapshot_name": "{{ user `distro` }}-{{ timestamp }}",
252 "region" : "ams2",
253 "size" : "1gb"
254 }
255 ]
256}