blob: 29ecd2dc9c0701d1d0d179a95614fe040f51183b [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,
Filip Pytlouna55513d2015-07-22 17:43:36 +020078 "output": "images/{{ user `distro` }}-{{.Provider}}-{{ timestamp }}.box",
Filip Pytloun7b48fd22015-06-30 23:34:01 +020079 "except": [ "digitalocean", "docker" ]
80 },
81 {
Filip Pytloun62c8f832015-07-22 17:40:00 +020082 "type": "docker-save",
83 "path": "images/{{ user `distro` }}-docker-{{ timestamp }}.tar",
84 "only": ["docker"]
jan kaufmana519d7b2015-03-04 00:51:47 +010085 }
86 ],
87 "builders": [
88 {
89 "type": "virtualbox-iso",
90 "boot_command": [
91 "<esc><wait>",
92 "<esc><wait>",
93 "<enter><wait>",
94 "/install/vmlinuz<wait>",
95 " auto<wait>",
96 " console-setup/ask_detect=false<wait>",
97 " console-setup/layoutcode=us<wait>",
98 " console-setup/modelcode=pc105<wait>",
99 " debconf/frontend=noninteractive<wait>",
100 " debian-installer=en_US<wait>",
101 " fb=false<wait>",
102 " initrd=/install/initrd.gz<wait>",
103 " kbd-chooser/method=us<wait>",
104 " keyboard-configuration/layout=USA<wait>",
105 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200106 " passwd/root-password={{user `password`}} ",
107 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100108 " locale=en_US<wait>",
109 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufmandfc08f02015-04-29 20:17:55 +0200110 " netcfg/get_domain=cloudlab.cz<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100111 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200112 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100113 " -- <wait>",
114 "<enter><wait>"
115 ],
116 "boot_wait": "5s",
117 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200118 "output_directory": "images/{{ user `distro` }}-vbox-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100119 "guest_os_type": "Ubuntu_64",
120 "http_directory": "http",
jan kaufmandfc08f02015-04-29 20:17:55 +0200121 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100122 "iso_checksum_type": "md5",
Filip Pytloun3f1b1102015-07-22 16:10:19 +0200123 "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 +0100124 "ssh_username": "{{user `user`}}",
125 "ssh_password": "{{user `password`}}",
126 "ssh_port": 22,
127 "ssh_wait_timeout": "10000s",
128 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
Filip Pytloun019c5d42015-07-22 18:59:15 +0200129 "headless": true,
jan kaufmana519d7b2015-03-04 00:51:47 +0100130 "vboxmanage": [
131 [ "modifyvm", "{{.Name}}", "--memory", "1024" ],
Filip Pytlouneb3957c2015-07-22 21:37:24 +0200132 [ "modifyvm", "{{.Name}}", "--cpus", "2" ],
Filip Pytloun04e6bc12015-07-22 21:51:35 +0200133 [ "modifyvm", "{{.Name}}", "--vrde", "on" ],
134 [ "modifyvm", "{{.Name}}", "--vrdeport", "5000-5050" ],
Filip Pytloun4e1f2a32015-07-22 22:50:38 +0200135 [ "modifyvm", "{{.Name}}", "--vrdeaddress", "127.0.0.1" ]
jan kaufmana519d7b2015-03-04 00:51:47 +0100136 ]
137 },
138 {
139 "type": "vmware-iso",
140 "boot_command": [
141 "<esc><wait>",
142 "<esc><wait>",
143 "<enter><wait>",
144 "/install/vmlinuz<wait>",
145 " auto<wait>",
146 " console-setup/ask_detect=false<wait>",
147 " console-setup/layoutcode=us<wait>",
148 " console-setup/modelcode=pc105<wait>",
149 " debconf/frontend=noninteractive<wait>",
150 " debian-installer=en_US<wait>",
151 " fb=false<wait>",
152 " initrd=/install/initrd.gz<wait>",
153 " kbd-chooser/method=us<wait>",
154 " keyboard-configuration/layout=USA<wait>",
155 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200156 " passwd/root-password={{user `password`}} ",
157 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100158 " locale=en_US<wait>",
159 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100160 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100161 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200162 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100163 " -- <wait>",
164 "<enter><wait>"
165 ],
166 "boot_wait": "5s",
167 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200168 "disk_type_id": 4,
169 "vmdk_name": "{{ user `distro`}}",
170 "output_directory": "images/{{ user `distro` }}-vmware-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100171 "guest_os_type": "linux",
172 "http_directory": "http",
jan kaufmandfc08f02015-04-29 20:17:55 +0200173 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100174 "iso_checksum_type": "md5",
Filip Pytloun3f1b1102015-07-22 16:10:19 +0200175 "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 +0100176 "ssh_username": "{{user `user`}}",
177 "ssh_password": "{{user `password`}}",
178 "ssh_port": 22,
179 "ssh_wait_timeout": "10000s",
180 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
181 "vmx_data": {
jan kaufmandfc08f02015-04-29 20:17:55 +0200182 "memsize": "1024",
jan kaufmana519d7b2015-03-04 00:51:47 +0100183 "numvcpus": "1",
184 "cpuid.coresPerSocket": "1"
185 }
186 },
187 {
188 "type": "qemu",
189 "vm_name": "{{ user `distro` }}-{{ timestamp }}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200190 "output_directory": "images/{{ user `distro` }}-qemu-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100191 "format": "qcow2",
192 "accelerator": "kvm",
193 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun3f1b1102015-07-22 16:10:19 +0200194 "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 +0100195 "iso_checksum_type": "md5",
jan kaufmandfc08f02015-04-29 20:17:55 +0200196 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100197 "http_directory": "http",
jan kaufman64b9f972015-03-11 11:31:28 +0100198 "headless": true,
jan kaufmana519d7b2015-03-04 00:51:47 +0100199 "ssh_username": "{{user `user`}}",
200 "ssh_password": "{{user `password`}}",
201 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
202 "boot_wait": "2s",
Filip Pytloun39832362015-06-25 18:05:47 +0200203 "ssh_wait_timeout": "10000s",
jan kaufmana519d7b2015-03-04 00:51:47 +0100204 "boot_command": [
205 "<esc><wait>",
206 "<esc><wait>",
207 "<enter><wait>",
208 "/install/vmlinuz<wait>",
209 " auto<wait>",
210 " console-setup/ask_detect=false<wait>",
211 " console-setup/layoutcode=us<wait>",
212 " console-setup/modelcode=pc105<wait>",
213 " debconf/frontend=noninteractive<wait>",
214 " debian-installer=en_US<wait>",
215 " fb=false<wait>",
216 " initrd=/install/initrd.gz<wait>",
217 " kbd-chooser/method=us<wait>",
218 " keyboard-configuration/layout=USA<wait>",
219 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200220 " passwd/root-password={{user `password`}} ",
221 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100222 " locale=en_US<wait>",
223 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100224 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100225 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200226 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100227 " -- <wait>",
228 "<enter><wait>"
229 ]
230 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200231 {
232 "type": "docker",
233 "image": "ubuntu:14.04",
234 "commit": true
Filip Pytloun896f37b2015-06-25 18:35:42 +0200235 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200236 {
jan kaufmana519d7b2015-03-04 00:51:47 +0100237 "type": "digitalocean",
238 "api_token": "{{user `do_api_token`}}",
239 "image": "{{user `distro`}}",
240 "snapshot_name": "{{ user `distro` }}-{{ timestamp }}",
241 "region" : "ams2",
242 "size" : "1gb"
243 }
244 ]
245}