blob: 7296c3c1317229ce22aaec4fa471ae6781c034d6 [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",
135 "vboxmanage": [
136 [ "modifyvm", "{{.Name}}", "--memory", "1024" ],
137 [ "modifyvm", "{{.Name}}", "--cpus", "2" ]
138 ]
139 },
140 {
141 "type": "vmware-iso",
142 "boot_command": [
143 "<esc><wait>",
144 "<esc><wait>",
145 "<enter><wait>",
146 "/install/vmlinuz<wait>",
147 " auto<wait>",
148 " console-setup/ask_detect=false<wait>",
149 " console-setup/layoutcode=us<wait>",
150 " console-setup/modelcode=pc105<wait>",
151 " debconf/frontend=noninteractive<wait>",
152 " debian-installer=en_US<wait>",
153 " fb=false<wait>",
154 " initrd=/install/initrd.gz<wait>",
155 " kbd-chooser/method=us<wait>",
156 " keyboard-configuration/layout=USA<wait>",
157 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200158 " passwd/root-password={{user `password`}} ",
159 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100160 " locale=en_US<wait>",
161 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100162 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100163 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200164 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100165 " -- <wait>",
166 "<enter><wait>"
167 ],
168 "boot_wait": "5s",
169 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200170 "disk_type_id": 4,
171 "vmdk_name": "{{ user `distro`}}",
172 "output_directory": "images/{{ user `distro` }}-vmware-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100173 "guest_os_type": "linux",
174 "http_directory": "http",
jan kaufmandfc08f02015-04-29 20:17:55 +0200175 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100176 "iso_checksum_type": "md5",
Filip Pytloun3f1b1102015-07-22 16:10:19 +0200177 "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 +0100178 "ssh_username": "{{user `user`}}",
179 "ssh_password": "{{user `password`}}",
180 "ssh_port": 22,
181 "ssh_wait_timeout": "10000s",
182 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
183 "vmx_data": {
jan kaufmandfc08f02015-04-29 20:17:55 +0200184 "memsize": "1024",
jan kaufmana519d7b2015-03-04 00:51:47 +0100185 "numvcpus": "1",
186 "cpuid.coresPerSocket": "1"
187 }
188 },
189 {
190 "type": "qemu",
191 "vm_name": "{{ user `distro` }}-{{ timestamp }}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200192 "output_directory": "images/{{ user `distro` }}-qemu-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100193 "format": "qcow2",
194 "accelerator": "kvm",
195 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun3f1b1102015-07-22 16:10:19 +0200196 "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 +0100197 "iso_checksum_type": "md5",
jan kaufmandfc08f02015-04-29 20:17:55 +0200198 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100199 "http_directory": "http",
jan kaufman64b9f972015-03-11 11:31:28 +0100200 "headless": true,
jan kaufmana519d7b2015-03-04 00:51:47 +0100201 "ssh_username": "{{user `user`}}",
202 "ssh_password": "{{user `password`}}",
203 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
204 "boot_wait": "2s",
Filip Pytloun39832362015-06-25 18:05:47 +0200205 "ssh_wait_timeout": "10000s",
jan kaufmana519d7b2015-03-04 00:51:47 +0100206 "boot_command": [
207 "<esc><wait>",
208 "<esc><wait>",
209 "<enter><wait>",
210 "/install/vmlinuz<wait>",
211 " auto<wait>",
212 " console-setup/ask_detect=false<wait>",
213 " console-setup/layoutcode=us<wait>",
214 " console-setup/modelcode=pc105<wait>",
215 " debconf/frontend=noninteractive<wait>",
216 " debian-installer=en_US<wait>",
217 " fb=false<wait>",
218 " initrd=/install/initrd.gz<wait>",
219 " kbd-chooser/method=us<wait>",
220 " keyboard-configuration/layout=USA<wait>",
221 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200222 " passwd/root-password={{user `password`}} ",
223 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100224 " locale=en_US<wait>",
225 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100226 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100227 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200228 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100229 " -- <wait>",
230 "<enter><wait>"
231 ]
232 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200233 {
234 "type": "docker",
235 "image": "ubuntu:14.04",
236 "commit": true
Filip Pytloun896f37b2015-06-25 18:35:42 +0200237 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200238 {
jan kaufmana519d7b2015-03-04 00:51:47 +0100239 "type": "digitalocean",
240 "api_token": "{{user `do_api_token`}}",
241 "image": "{{user `distro`}}",
242 "snapshot_name": "{{ user `distro` }}-{{ timestamp }}",
243 "region" : "ams2",
244 "size" : "1gb"
245 }
246 ]
247}