blob: 3d3f9fd2497d69131185ea80dfe73fae9751fe69 [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" ],
Filip Pytlouneb3957c2015-07-22 21:37:24 +0200138 [ "modifyvm", "{{.Name}}", "--cpus", "2" ],
Filip Pytloun04e6bc12015-07-22 21:51:35 +0200139 [ "modifyvm", "{{.Name}}", "--vrde", "on" ],
140 [ "modifyvm", "{{.Name}}", "--vrdeport", "5000-5050" ],
Filip Pytloun771f59c2015-07-22 22:29:34 +0200141 [ "modifyvm", "{{.Name}}", "--vrdeaddress", "127.0.0.1" ],
Filip Pytloun598ed522015-07-22 22:36:27 +0200142 [ "modifyvm", "{{.Name}}", "--hwvirtex", "off" ],
Filip Pytloun0f27f582015-07-22 22:46:30 +0200143 [ "modifyvm", "{{.Name}}", "--vtxvpid", "off" ],
144 [ "modifyvm", "{{.Name}}", "--vtxux", "off" ],
145 [ "modifyvm", "{{.Name}}", "--nestedpaging", "off" ],
146 [ "modifyvm", "{{.Name}}", "--pae", "off" ]
jan kaufmana519d7b2015-03-04 00:51:47 +0100147 ]
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}