blob: 2faeb1a585749b4ca851c14e94d57fb7ffe47869 [file] [log] [blame]
Filip Pytloun7ae5c752016-01-15 13:48:38 +01001{
2 "variables": {
3 "user": "root",
4 "password": "ho5uo7Uome5d",
5 "do_api_token": "{{ env `DO_API_TOKEN` }}",
6 "distro": "ubuntu-16-04-x64",
7 "disk_size": "8000"
8 },
9
10 "provisioners": [
11 {
12 "type": "shell",
13 "execute_command": "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",
21 "scripts/security.sh",
22 "scripts/cleanup.sh",
23 "scripts/zerodisk.sh"
24 ]
25 },
26 "vmware-iso": {
27 "scripts": [
28 "scripts/base.sh",
29 "scripts/salt.sh",
30 "scripts/vmware.sh",
31 "scripts/security.sh",
32 "scripts/cleanup.sh",
33 "scripts/zerodisk.sh"
34 ]
35 },
36 "qemu": {
37 "scripts": [
38 "scripts/base.sh",
39 "scripts/salt.sh",
40 "scripts/foreman.sh",
41 "scripts/security.sh",
42 "scripts/cleanup.sh",
43 "scripts/zerodisk.sh"
44 ]
45 },
46 "docker": {
47 "scripts": [
48 "scripts/docker.sh",
49 "scripts/base.sh",
50 "scripts/salt.sh",
51 "scripts/cleanup.sh"
52 ]
53 },
54 "digitalocean": {
55 "scripts": [
56 "scripts/base.sh",
57 "scripts/salt.sh",
58 "scripts/security.sh",
59 "scripts/cleanup.sh"
60 ]
61 }
62 }
63 },
64 {
65 "type": "file",
66 "source": "configs/cloud/cloud.cfg.d/99_tcp.cfg",
67 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
68 },
69 {
70 "type": "file",
71 "source": "configs/cloud/cloud.cfg",
72 "destination": "/etc/cloud/cloud.cfg"
73 }
74 ],
75 "post-processors": [
76 {
77 "type": "vagrant",
78 "keep_input_artifact": true,
79 "output": "images/{{ user `distro` }}-{{.Provider}}-{{ timestamp }}.box",
80 "except": [ "digitalocean", "docker" ]
81 },
82 {
83 "type": "docker-tag",
Filip Pytlounc2b0ca02016-06-09 16:26:30 +020084 "repository": "tcpcloud/ubuntu",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010085 "tag": "16.04",
86 "only": ["docker"]
87 },
88 {
89 "type": "docker-save",
90 "path": "images/{{ user `distro` }}-docker-{{ timestamp }}.tar",
91 "only": ["docker"]
92 }
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>",
113 " passwd/root-password={{user `password`}} ",
114 " passwd/root-password-again={{user `password`}} ",
115 " locale=en_US<wait>",
116 " netcfg/get_hostname=ubuntu-1604<wait>",
117 " netcfg/get_domain=cloudlab.cz<wait>",
118 " noapic<wait>",
119 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
120 " -- <wait>",
121 "<enter><wait>"
122 ],
123 "boot_wait": "5s",
124 "disk_size": "{{ user `disk_size`}}",
125 "output_directory": "images/{{ user `distro` }}-vbox-{{ timestamp }}",
126 "guest_os_type": "Ubuntu_64",
127 "http_directory": "http",
Filip Pytloun93b5a2e2016-06-09 16:19:39 +0200128 "iso_checksum": "23e97cd5d4145d4105fbf29878534049",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100129 "iso_checksum_type": "md5",
Filip Pytloun93b5a2e2016-06-09 16:19:39 +0200130 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100131 "ssh_username": "{{user `user`}}",
132 "ssh_password": "{{user `password`}}",
133 "ssh_port": 22,
134 "ssh_wait_timeout": "10000s",
135 "shutdown_command": "shutdown -P now",
136 "headless": true,
137 "vboxmanage": [
138 [ "modifyvm", "{{.Name}}", "--memory", "1024" ],
139 [ "modifyvm", "{{.Name}}", "--cpus", "2" ],
140 [ "modifyvm", "{{.Name}}", "--vrde", "on" ],
141 [ "modifyvm", "{{.Name}}", "--vrdeport", "5000-5050" ],
142 [ "modifyvm", "{{.Name}}", "--vrdeaddress", "127.0.0.1" ]
143 ]
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>",
163 " passwd/root-password={{user `password`}} ",
164 " passwd/root-password-again={{user `password`}} ",
165 " locale=en_US<wait>",
166 " netcfg/get_hostname=ubuntu-1604<wait>",
167 " netcfg/get_domain=changeme<wait>",
168 " noapic<wait>",
169 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
170 " -- <wait>",
171 "<enter><wait>"
172 ],
173 "boot_wait": "5s",
174 "disk_size": "{{ user `disk_size`}}",
175 "disk_type_id": 4,
176 "vmdk_name": "{{ user `distro`}}",
177 "output_directory": "images/{{ user `distro` }}-vmware-{{ timestamp }}",
178 "guest_os_type": "linux",
179 "http_directory": "http",
Filip Pytloun93b5a2e2016-06-09 16:19:39 +0200180 "iso_checksum": "23e97cd5d4145d4105fbf29878534049",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100181 "iso_checksum_type": "md5",
Filip Pytloun93b5a2e2016-06-09 16:19:39 +0200182 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100183 "ssh_username": "{{user `user`}}",
184 "ssh_password": "{{user `password`}}",
185 "ssh_port": 22,
186 "ssh_wait_timeout": "10000s",
187 "shutdown_command": "shutdown -P now",
188 "vmx_data": {
189 "memsize": "1024",
190 "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 Pytloun7ae5c752016-01-15 13:48:38 +0100199 "vm_name": "{{ user `distro` }}-{{ timestamp }}",
200 "output_directory": "images/{{ user `distro` }}-qemu-{{ timestamp }}",
201 "format": "qcow2",
202 "accelerator": "kvm",
203 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun93b5a2e2016-06-09 16:19:39 +0200204 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100205 "iso_checksum_type": "md5",
Filip Pytloun93b5a2e2016-06-09 16:19:39 +0200206 "iso_checksum": "23e97cd5d4145d4105fbf29878534049",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100207 "http_directory": "http",
208 "headless": true,
209 "ssh_username": "{{user `user`}}",
210 "ssh_password": "{{user `password`}}",
211 "shutdown_command": "shutdown -P now",
212 "boot_wait": "2s",
213 "ssh_wait_timeout": "10000s",
214 "boot_command": [
215 "<enter><wait>",
216 "<f6><esc>",
217 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
218 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
219 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
220 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
221 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
222 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
223 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
224 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
225 "<bs><bs><bs>",
226 "/install/vmlinuz<wait>",
227 " auto<wait>",
228 " console-setup/ask_detect=false<wait>",
229 " console-setup/layoutcode=us<wait>",
230 " console-setup/modelcode=pc105<wait>",
231 " debconf/frontend=noninteractive<wait>",
232 " debian-installer=en_US<wait>",
233 " fb=false<wait>",
234 " initrd=/install/initrd.gz<wait>",
235 " kbd-chooser/method=us<wait>",
236 " keyboard-configuration/layout=USA<wait>",
237 " keyboard-configuration/variant=USA<wait>",
238 " passwd/root-password={{user `password`}} ",
239 " passwd/root-password-again={{user `password`}} ",
240 " locale=en_US<wait>",
241 " netcfg/get_hostname=ubuntu-1604<wait>",
242 " netcfg/get_domain=changeme<wait>",
243 " noapic<wait>",
244 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
245 " -- <wait>",
246 "<enter><wait>"
247 ]
248 },
249 {
250 "type": "docker",
251 "image": "ubuntu:16.04",
252 "commit": true
253 },
254 {
255 "type": "digitalocean",
256 "api_token": "{{user `do_api_token`}}",
257 "image": "{{user `distro`}}",
258 "snapshot_name": "{{ user `distro` }}-{{ timestamp }}",
259 "region" : "ams2",
260 "size" : "1gb"
261 }
262 ]
263}