blob: a09df69b0487ba4c83ae5ad3412953447ebd5834 [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",
Filip Pytloune7dce992016-01-08 12:52:57 +010013 "execute_command": "sh '{{.Path}}'",
jan kaufmana519d7b2015-03-04 00:51:47 +010014 "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 Pytloune6e6e192015-08-10 15:45:03 +020040 "scripts/foreman.sh",
Filip Pytloun896f37b2015-06-25 18:35:42 +020041 "scripts/security.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010042 "scripts/cleanup.sh",
43 "scripts/zerodisk.sh"
44 ]
45 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +020046 "docker": {
47 "scripts": [
48 "scripts/docker.sh",
49 "scripts/base.sh",
50 "scripts/salt.sh",
51 "scripts/cleanup.sh"
52 ]
53 },
jan kaufmana519d7b2015-03-04 00:51:47 +010054 "digitalocean": {
55 "scripts": [
56 "scripts/base.sh",
57 "scripts/salt.sh",
Filip Pytloun896f37b2015-06-25 18:35:42 +020058 "scripts/security.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010059 "scripts/cleanup.sh"
60 ]
61 }
62 }
jan kaufman0fcf1a72015-05-06 10:16:12 +020063 },
64 {
65 "type": "file",
66 "source": "configs/cloud/cloud.cfg.d/99_tcp.cfg",
67 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
Filip Pytloun60411d12015-06-25 21:14:41 +020068 },
69 {
70 "type": "file",
71 "source": "configs/cloud/cloud.cfg",
72 "destination": "/etc/cloud/cloud.cfg"
jan kaufmana519d7b2015-03-04 00:51:47 +010073 }
74 ],
75 "post-processors": [
76 {
77 "type": "vagrant",
78 "keep_input_artifact": true,
Filip Pytloun29eb06e2016-08-22 19:40:57 +020079 "output": "images/{{ user `distro` }}-{{.Provider}}-{{ isotime "20060102030405" }}.box",
Filip Pytloun7b48fd22015-06-30 23:34:01 +020080 "except": [ "digitalocean", "docker" ]
81 },
82 {
Filip Pytloun6e4c3b72015-07-23 09:20:13 +020083 "type": "docker-tag",
Filip Pytlounc2b0ca02016-06-09 16:26:30 +020084 "repository": "tcpcloud/ubuntu",
Filip Pytloun6e4c3b72015-07-23 09:20:13 +020085 "tag": "14.04",
86 "only": ["docker"]
87 },
88 {
Filip Pytloun62c8f832015-07-22 17:40:00 +020089 "type": "docker-save",
Filip Pytloun29eb06e2016-08-22 19:40:57 +020090 "path": "images/{{ user `distro` }}-docker-{{ isotime "20060102030405" }}.tar",
Filip Pytloun62c8f832015-07-22 17:40:00 +020091 "only": ["docker"]
jan kaufmana519d7b2015-03-04 00:51:47 +010092 }
93 ],
94 "builders": [
95 {
96 "type": "virtualbox-iso",
97 "boot_command": [
98 "<esc><wait>",
99 "<esc><wait>",
100 "<enter><wait>",
101 "/install/vmlinuz<wait>",
102 " auto<wait>",
103 " console-setup/ask_detect=false<wait>",
104 " console-setup/layoutcode=us<wait>",
105 " console-setup/modelcode=pc105<wait>",
106 " debconf/frontend=noninteractive<wait>",
107 " debian-installer=en_US<wait>",
108 " fb=false<wait>",
109 " initrd=/install/initrd.gz<wait>",
110 " kbd-chooser/method=us<wait>",
111 " keyboard-configuration/layout=USA<wait>",
112 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200113 " passwd/root-password={{user `password`}} ",
114 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100115 " locale=en_US<wait>",
116 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufmandfc08f02015-04-29 20:17:55 +0200117 " netcfg/get_domain=cloudlab.cz<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100118 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200119 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100120 " -- <wait>",
121 "<enter><wait>"
122 ],
123 "boot_wait": "5s",
124 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun29eb06e2016-08-22 19:40:57 +0200125 "output_directory": "images/{{ user `distro` }}-vbox-{{ isotime "20060102030405" }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100126 "guest_os_type": "Ubuntu_64",
127 "http_directory": "http",
Filip Pytloun4b3f3852016-02-19 08:57:38 +0100128 "iso_checksum": "2ac1f3e0de626e54d05065d6f549fa3a",
jan kaufmana519d7b2015-03-04 00:51:47 +0100129 "iso_checksum_type": "md5",
Filip Pytloun4b3f3852016-02-19 08:57:38 +0100130 "iso_url": "http://releases.ubuntu.mirror.dkm.cz/releases/14.04/ubuntu-14.04.4-server-amd64.iso",
jan kaufmana519d7b2015-03-04 00:51:47 +0100131 "ssh_username": "{{user `user`}}",
132 "ssh_password": "{{user `password`}}",
133 "ssh_port": 22,
134 "ssh_wait_timeout": "10000s",
Filip Pytloune7dce992016-01-08 12:52:57 +0100135 "shutdown_command": "shutdown -P now",
Filip Pytloun019c5d42015-07-22 18:59:15 +0200136 "headless": true,
jan kaufmana519d7b2015-03-04 00:51:47 +0100137 "vboxmanage": [
138 [ "modifyvm", "{{.Name}}", "--memory", "1024" ],
Filip Pytlouneb3957c2015-07-22 21:37:24 +0200139 [ "modifyvm", "{{.Name}}", "--cpus", "2" ],
Filip Pytloun04e6bc12015-07-22 21:51:35 +0200140 [ "modifyvm", "{{.Name}}", "--vrde", "on" ],
141 [ "modifyvm", "{{.Name}}", "--vrdeport", "5000-5050" ],
Filip Pytloun4e1f2a32015-07-22 22:50:38 +0200142 [ "modifyvm", "{{.Name}}", "--vrdeaddress", "127.0.0.1" ]
jan kaufmana519d7b2015-03-04 00:51:47 +0100143 ]
144 },
145 {
146 "type": "vmware-iso",
147 "boot_command": [
148 "<esc><wait>",
149 "<esc><wait>",
150 "<enter><wait>",
151 "/install/vmlinuz<wait>",
152 " auto<wait>",
153 " console-setup/ask_detect=false<wait>",
154 " console-setup/layoutcode=us<wait>",
155 " console-setup/modelcode=pc105<wait>",
156 " debconf/frontend=noninteractive<wait>",
157 " debian-installer=en_US<wait>",
158 " fb=false<wait>",
159 " initrd=/install/initrd.gz<wait>",
160 " kbd-chooser/method=us<wait>",
161 " keyboard-configuration/layout=USA<wait>",
162 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200163 " passwd/root-password={{user `password`}} ",
164 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100165 " locale=en_US<wait>",
166 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100167 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100168 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200169 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100170 " -- <wait>",
171 "<enter><wait>"
172 ],
173 "boot_wait": "5s",
174 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200175 "disk_type_id": 4,
176 "vmdk_name": "{{ user `distro`}}",
Filip Pytloun29eb06e2016-08-22 19:40:57 +0200177 "output_directory": "images/{{ user `distro` }}-vmware-{{ isotime "20060102030405" }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100178 "guest_os_type": "linux",
179 "http_directory": "http",
Filip Pytloun4b3f3852016-02-19 08:57:38 +0100180 "iso_checksum": "2ac1f3e0de626e54d05065d6f549fa3a",
jan kaufmana519d7b2015-03-04 00:51:47 +0100181 "iso_checksum_type": "md5",
Filip Pytloun4b3f3852016-02-19 08:57:38 +0100182 "iso_url": "http://releases.ubuntu.mirror.dkm.cz/releases/14.04/ubuntu-14.04.4-server-amd64.iso",
jan kaufmana519d7b2015-03-04 00:51:47 +0100183 "ssh_username": "{{user `user`}}",
184 "ssh_password": "{{user `password`}}",
185 "ssh_port": 22,
186 "ssh_wait_timeout": "10000s",
Filip Pytloune7dce992016-01-08 12:52:57 +0100187 "shutdown_command": "shutdown -P now",
jan kaufmana519d7b2015-03-04 00:51:47 +0100188 "vmx_data": {
jan kaufmandfc08f02015-04-29 20:17:55 +0200189 "memsize": "1024",
jan kaufmana519d7b2015-03-04 00:51:47 +0100190 "numvcpus": "1",
191 "cpuid.coresPerSocket": "1"
192 }
193 },
194 {
195 "type": "qemu",
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100196 "qemuargs": [
197 [ "-m", "1024M" ]
198 ],
Filip Pytloun29eb06e2016-08-22 19:40:57 +0200199 "vm_name": "{{ user `distro` }}-{{ isotime "20060102030405" }}",
200 "output_directory": "images/{{ user `distro` }}-qemu-{{ isotime "20060102030405" }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100201 "format": "qcow2",
202 "accelerator": "kvm",
203 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun4b3f3852016-02-19 08:57:38 +0100204 "iso_url": "http://releases.ubuntu.mirror.dkm.cz/releases/14.04/ubuntu-14.04.4-server-amd64.iso",
jan kaufmana519d7b2015-03-04 00:51:47 +0100205 "iso_checksum_type": "md5",
Filip Pytloun4b3f3852016-02-19 08:57:38 +0100206 "iso_checksum": "2ac1f3e0de626e54d05065d6f549fa3a",
jan kaufmana519d7b2015-03-04 00:51:47 +0100207 "http_directory": "http",
jan kaufman64b9f972015-03-11 11:31:28 +0100208 "headless": true,
jan kaufmana519d7b2015-03-04 00:51:47 +0100209 "ssh_username": "{{user `user`}}",
210 "ssh_password": "{{user `password`}}",
Filip Pytloune7dce992016-01-08 12:52:57 +0100211 "shutdown_command": "shutdown -P now",
jan kaufmana519d7b2015-03-04 00:51:47 +0100212 "boot_wait": "2s",
Filip Pytloun39832362015-06-25 18:05:47 +0200213 "ssh_wait_timeout": "10000s",
jan kaufmana519d7b2015-03-04 00:51:47 +0100214 "boot_command": [
215 "<esc><wait>",
216 "<esc><wait>",
217 "<enter><wait>",
218 "/install/vmlinuz<wait>",
219 " auto<wait>",
220 " console-setup/ask_detect=false<wait>",
221 " console-setup/layoutcode=us<wait>",
222 " console-setup/modelcode=pc105<wait>",
223 " debconf/frontend=noninteractive<wait>",
224 " debian-installer=en_US<wait>",
225 " fb=false<wait>",
226 " initrd=/install/initrd.gz<wait>",
227 " kbd-chooser/method=us<wait>",
228 " keyboard-configuration/layout=USA<wait>",
229 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200230 " passwd/root-password={{user `password`}} ",
231 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100232 " locale=en_US<wait>",
233 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100234 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100235 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200236 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100237 " -- <wait>",
238 "<enter><wait>"
239 ]
240 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200241 {
242 "type": "docker",
243 "image": "ubuntu:14.04",
244 "commit": true
Filip Pytloun896f37b2015-06-25 18:35:42 +0200245 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200246 {
jan kaufmana519d7b2015-03-04 00:51:47 +0100247 "type": "digitalocean",
248 "api_token": "{{user `do_api_token`}}",
249 "image": "{{user `distro`}}",
Filip Pytloun29eb06e2016-08-22 19:40:57 +0200250 "snapshot_name": "{{ user `distro` }}-{{ isotime "20060102030405" }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100251 "region" : "ams2",
252 "size" : "1gb"
253 }
254 ]
255}