blob: 32a28e1de2ac4b8367fa9cb546fc4e8a639ce6e7 [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 {
82 "type": "docker-tag",
83 "repository": "cloudlab/ubuntu",
Filip Pytloun7d733bc2015-07-11 08:34:49 +020084 "tag": "14.04",
85 "only": ["docker"]
Filip Pytloun62c8f832015-07-22 17:40:00 +020086 },
87 {
88 "type": "docker-save",
89 "path": "images/{{ user `distro` }}-docker-{{ timestamp }}.tar",
90 "only": ["docker"]
jan kaufmana519d7b2015-03-04 00:51:47 +010091 }
92 ],
93 "builders": [
94 {
95 "type": "virtualbox-iso",
96 "boot_command": [
97 "<esc><wait>",
98 "<esc><wait>",
99 "<enter><wait>",
100 "/install/vmlinuz<wait>",
101 " auto<wait>",
102 " console-setup/ask_detect=false<wait>",
103 " console-setup/layoutcode=us<wait>",
104 " console-setup/modelcode=pc105<wait>",
105 " debconf/frontend=noninteractive<wait>",
106 " debian-installer=en_US<wait>",
107 " fb=false<wait>",
108 " initrd=/install/initrd.gz<wait>",
109 " kbd-chooser/method=us<wait>",
110 " keyboard-configuration/layout=USA<wait>",
111 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200112 " passwd/root-password={{user `password`}} ",
113 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100114 " locale=en_US<wait>",
115 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufmandfc08f02015-04-29 20:17:55 +0200116 " netcfg/get_domain=cloudlab.cz<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100117 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200118 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100119 " -- <wait>",
120 "<enter><wait>"
121 ],
122 "boot_wait": "5s",
123 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200124 "output_directory": "images/{{ user `distro` }}-vbox-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100125 "guest_os_type": "Ubuntu_64",
126 "http_directory": "http",
jan kaufmandfc08f02015-04-29 20:17:55 +0200127 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100128 "iso_checksum_type": "md5",
Filip Pytloun3f1b1102015-07-22 16:10:19 +0200129 "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 +0100130 "ssh_username": "{{user `user`}}",
131 "ssh_password": "{{user `password`}}",
132 "ssh_port": 22,
133 "ssh_wait_timeout": "10000s",
134 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
Filip Pytloun019c5d42015-07-22 18:59:15 +0200135 "headless": true,
jan kaufmana519d7b2015-03-04 00:51:47 +0100136 "vboxmanage": [
137 [ "modifyvm", "{{.Name}}", "--memory", "1024" ],
138 [ "modifyvm", "{{.Name}}", "--cpus", "2" ]
139 ]
140 },
141 {
142 "type": "vmware-iso",
143 "boot_command": [
144 "<esc><wait>",
145 "<esc><wait>",
146 "<enter><wait>",
147 "/install/vmlinuz<wait>",
148 " auto<wait>",
149 " console-setup/ask_detect=false<wait>",
150 " console-setup/layoutcode=us<wait>",
151 " console-setup/modelcode=pc105<wait>",
152 " debconf/frontend=noninteractive<wait>",
153 " debian-installer=en_US<wait>",
154 " fb=false<wait>",
155 " initrd=/install/initrd.gz<wait>",
156 " kbd-chooser/method=us<wait>",
157 " keyboard-configuration/layout=USA<wait>",
158 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200159 " passwd/root-password={{user `password`}} ",
160 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100161 " locale=en_US<wait>",
162 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100163 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100164 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200165 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100166 " -- <wait>",
167 "<enter><wait>"
168 ],
169 "boot_wait": "5s",
170 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200171 "disk_type_id": 4,
172 "vmdk_name": "{{ user `distro`}}",
173 "output_directory": "images/{{ user `distro` }}-vmware-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100174 "guest_os_type": "linux",
175 "http_directory": "http",
jan kaufmandfc08f02015-04-29 20:17:55 +0200176 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100177 "iso_checksum_type": "md5",
Filip Pytloun3f1b1102015-07-22 16:10:19 +0200178 "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 +0100179 "ssh_username": "{{user `user`}}",
180 "ssh_password": "{{user `password`}}",
181 "ssh_port": 22,
182 "ssh_wait_timeout": "10000s",
183 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
184 "vmx_data": {
jan kaufmandfc08f02015-04-29 20:17:55 +0200185 "memsize": "1024",
jan kaufmana519d7b2015-03-04 00:51:47 +0100186 "numvcpus": "1",
187 "cpuid.coresPerSocket": "1"
188 }
189 },
190 {
191 "type": "qemu",
192 "vm_name": "{{ user `distro` }}-{{ timestamp }}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200193 "output_directory": "images/{{ user `distro` }}-qemu-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100194 "format": "qcow2",
195 "accelerator": "kvm",
196 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun3f1b1102015-07-22 16:10:19 +0200197 "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 +0100198 "iso_checksum_type": "md5",
jan kaufmandfc08f02015-04-29 20:17:55 +0200199 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100200 "http_directory": "http",
jan kaufman64b9f972015-03-11 11:31:28 +0100201 "headless": true,
jan kaufmana519d7b2015-03-04 00:51:47 +0100202 "ssh_username": "{{user `user`}}",
203 "ssh_password": "{{user `password`}}",
204 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
205 "boot_wait": "2s",
Filip Pytloun39832362015-06-25 18:05:47 +0200206 "ssh_wait_timeout": "10000s",
jan kaufmana519d7b2015-03-04 00:51:47 +0100207 "boot_command": [
208 "<esc><wait>",
209 "<esc><wait>",
210 "<enter><wait>",
211 "/install/vmlinuz<wait>",
212 " auto<wait>",
213 " console-setup/ask_detect=false<wait>",
214 " console-setup/layoutcode=us<wait>",
215 " console-setup/modelcode=pc105<wait>",
216 " debconf/frontend=noninteractive<wait>",
217 " debian-installer=en_US<wait>",
218 " fb=false<wait>",
219 " initrd=/install/initrd.gz<wait>",
220 " kbd-chooser/method=us<wait>",
221 " keyboard-configuration/layout=USA<wait>",
222 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200223 " passwd/root-password={{user `password`}} ",
224 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100225 " locale=en_US<wait>",
226 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100227 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100228 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200229 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100230 " -- <wait>",
231 "<enter><wait>"
232 ]
233 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200234 {
235 "type": "docker",
236 "image": "ubuntu:14.04",
237 "commit": true
Filip Pytloun896f37b2015-06-25 18:35:42 +0200238 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200239 {
jan kaufmana519d7b2015-03-04 00:51:47 +0100240 "type": "digitalocean",
241 "api_token": "{{user `do_api_token`}}",
242 "image": "{{user `distro`}}",
243 "snapshot_name": "{{ user `distro` }}-{{ timestamp }}",
244 "region" : "ams2",
245 "size" : "1gb"
246 }
247 ]
248}