blob: 564dd69992bce4ebdc20ef59cab6248fe8911d70 [file] [log] [blame]
Filip Pytloun7ae5c752016-01-15 13:48:38 +01001{
azvyagintsevd8f85232017-10-02 15:30:28 +03002 "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 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +01009 "provisioners": [
10 {
11 "type": "shell",
12 "execute_command": "sh '{{.Path}}'",
13 "override": {
14 "virtualbox-iso": {
15 "scripts": [
16 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020017 "scripts/motd.sh",
Jakub Josef6bcf3862017-05-03 16:16:39 +020018 "scripts/salt.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030019 "scripts/network.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010020 "scripts/vagrant.sh",
21 "scripts/virtualbox.sh",
22 "scripts/security.sh",
23 "scripts/cleanup.sh",
24 "scripts/zerodisk.sh"
25 ]
26 },
27 "vmware-iso": {
28 "scripts": [
29 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020030 "scripts/motd.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010031 "scripts/salt.sh",
32 "scripts/vmware.sh",
33 "scripts/security.sh",
34 "scripts/cleanup.sh",
35 "scripts/zerodisk.sh"
36 ]
37 },
azvyagintsevd8f85232017-10-02 15:30:28 +030038 "qemu": {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010039 "scripts": [
40 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020041 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030042 "scripts/salt.sh",
Jakub Josef6bcf3862017-05-03 16:16:39 +020043 "scripts/network.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010044 "scripts/security.sh",
45 "scripts/cleanup.sh",
46 "scripts/zerodisk.sh"
47 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030048 },
49 "docker": {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010050 "scripts": [
51 "scripts/docker.sh",
52 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020053 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030054 "scripts/salt.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010055 "scripts/cleanup.sh"
56 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030057 },
58 "digitalocean": {
59 "scripts": [
60 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020061 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030062 "scripts/salt.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010063 "scripts/security.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030064 "scripts/cleanup.sh"
65 ]
66 }
Filip Pytloun7ae5c752016-01-15 13:48:38 +010067 }
68 },
69 {
70 "type": "file",
alexz5b795142018-02-13 15:59:28 +010071 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010072 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
73 },
74 {
75 "type": "file",
alexz5b795142018-02-13 15:59:28 +010076 "source": "files/etc/cloud/cloud.cfg",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010077 "destination": "/etc/cloud/cloud.cfg"
78 }
79 ],
80 "post-processors": [
81 {
82 "type": "vagrant",
83 "keep_input_artifact": true,
Filip Pytloun451bc982017-03-13 16:21:24 +010084 "output": "images/{{ user `distro` }}-{{.Provider}}-{{ isotime \"200601021504\" }}.box",
azvyagintsevd8f85232017-10-02 15:30:28 +030085 "except": [
86 "digitalocean",
87 "docker"
88 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +010089 },
90 {
91 "type": "docker-tag",
Filip Pytlounc2b0ca02016-06-09 16:26:30 +020092 "repository": "tcpcloud/ubuntu",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010093 "tag": "16.04",
azvyagintsevd8f85232017-10-02 15:30:28 +030094 "only": [
95 "docker"
96 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +010097 },
98 {
99 "type": "docker-save",
Filip Pytloun451bc982017-03-13 16:21:24 +0100100 "path": "images/{{ user `distro` }}-docker-{{ isotime \"200601021504\" }}.tar",
azvyagintsevd8f85232017-10-02 15:30:28 +0300101 "only": [
102 "docker"
103 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100104 }
105 ],
106 "builders": [
107 {
108 "type": "virtualbox-iso",
109 "boot_command": [
110 "<esc><wait>",
111 "<esc><wait>",
112 "<enter><wait>",
113 "/install/vmlinuz<wait>",
114 " auto<wait>",
115 " console-setup/ask_detect=false<wait>",
116 " console-setup/layoutcode=us<wait>",
117 " console-setup/modelcode=pc105<wait>",
118 " debconf/frontend=noninteractive<wait>",
119 " debian-installer=en_US<wait>",
120 " fb=false<wait>",
121 " initrd=/install/initrd.gz<wait>",
122 " kbd-chooser/method=us<wait>",
123 " keyboard-configuration/layout=USA<wait>",
124 " keyboard-configuration/variant=USA<wait>",
125 " passwd/root-password={{user `password`}} ",
126 " passwd/root-password-again={{user `password`}} ",
127 " locale=en_US<wait>",
128 " netcfg/get_hostname=ubuntu-1604<wait>",
129 " netcfg/get_domain=cloudlab.cz<wait>",
130 " noapic<wait>",
131 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
132 " -- <wait>",
133 "<enter><wait>"
134 ],
135 "boot_wait": "5s",
136 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun451bc982017-03-13 16:21:24 +0100137 "output_directory": "images/{{ user `distro` }}-vbox-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100138 "guest_os_type": "Ubuntu_64",
139 "http_directory": "http",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200140 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100141 "iso_checksum_type": "md5",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200142 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100143 "ssh_username": "{{user `user`}}",
144 "ssh_password": "{{user `password`}}",
145 "ssh_port": 22,
146 "ssh_wait_timeout": "10000s",
147 "shutdown_command": "shutdown -P now",
148 "headless": true,
149 "vboxmanage": [
azvyagintsevd8f85232017-10-02 15:30:28 +0300150 [
151 "modifyvm",
152 "{{.Name}}",
153 "--memory",
154 "1024"
155 ],
156 [
157 "modifyvm",
158 "{{.Name}}",
159 "--cpus",
160 "2"
161 ],
162 [
163 "modifyvm",
164 "{{.Name}}",
165 "--vrde",
166 "on"
167 ],
168 [
169 "modifyvm",
170 "{{.Name}}",
171 "--vrdeport",
172 "5000-5050"
173 ],
174 [
175 "modifyvm",
176 "{{.Name}}",
177 "--vrdeaddress",
178 "127.0.0.1"
179 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100180 ]
181 },
182 {
183 "type": "vmware-iso",
184 "boot_command": [
185 "<esc><wait>",
186 "<esc><wait>",
187 "<enter><wait>",
188 "/install/vmlinuz<wait>",
189 " auto<wait>",
190 " console-setup/ask_detect=false<wait>",
191 " console-setup/layoutcode=us<wait>",
192 " console-setup/modelcode=pc105<wait>",
193 " debconf/frontend=noninteractive<wait>",
194 " debian-installer=en_US<wait>",
195 " fb=false<wait>",
196 " initrd=/install/initrd.gz<wait>",
197 " kbd-chooser/method=us<wait>",
198 " keyboard-configuration/layout=USA<wait>",
199 " keyboard-configuration/variant=USA<wait>",
200 " passwd/root-password={{user `password`}} ",
201 " passwd/root-password-again={{user `password`}} ",
202 " locale=en_US<wait>",
203 " netcfg/get_hostname=ubuntu-1604<wait>",
204 " netcfg/get_domain=changeme<wait>",
205 " noapic<wait>",
206 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
207 " -- <wait>",
208 "<enter><wait>"
209 ],
210 "boot_wait": "5s",
211 "disk_size": "{{ user `disk_size`}}",
212 "disk_type_id": 4,
213 "vmdk_name": "{{ user `distro`}}",
Filip Pytloun451bc982017-03-13 16:21:24 +0100214 "output_directory": "images/{{ user `distro` }}-vmware-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100215 "guest_os_type": "linux",
216 "http_directory": "http",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200217 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100218 "iso_checksum_type": "md5",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200219 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100220 "ssh_username": "{{user `user`}}",
221 "ssh_password": "{{user `password`}}",
222 "ssh_port": 22,
223 "ssh_wait_timeout": "10000s",
224 "shutdown_command": "shutdown -P now",
225 "vmx_data": {
226 "memsize": "1024",
227 "numvcpus": "1",
228 "cpuid.coresPerSocket": "1"
229 }
230 },
231 {
232 "type": "qemu",
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100233 "qemuargs": [
alexz5b795142018-02-13 15:59:28 +0100234 [ "-m", "1024M" ],
235 [ "-fda", "config-drive/cloudata.iso" ]
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100236 ],
Filip Pytloun451bc982017-03-13 16:21:24 +0100237 "vm_name": "{{ user `distro` }}-{{ isotime \"200601021504\" }}",
238 "output_directory": "images/{{ user `distro` }}-qemu-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100239 "format": "qcow2",
Richard Felkla5a44262018-03-12 15:11:32 +0100240 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
alexz5b795142018-02-13 15:59:28 +0100241 "iso_checksum_type": "md5",
Richard Felkla5a44262018-03-12 15:11:32 +0100242 "iso_url": "https://cloud-images.ubuntu.com/releases/16.04/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img",
alexz5b795142018-02-13 15:59:28 +0100243 "disk_image": true,
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100244 "accelerator": "kvm",
245 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100246 "headless": true,
247 "ssh_username": "{{user `user`}}",
248 "ssh_password": "{{user `password`}}",
249 "shutdown_command": "shutdown -P now",
250 "boot_wait": "2s",
alexz5b795142018-02-13 15:59:28 +0100251 "ssh_wait_timeout": "360s"
azvyagintsevd8f85232017-10-02 15:30:28 +0300252 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100253 {
254 "type": "docker",
255 "image": "ubuntu:16.04",
256 "commit": true
257 },
258 {
259 "type": "digitalocean",
260 "api_token": "{{user `do_api_token`}}",
261 "image": "{{user `distro`}}",
Filip Pytloun451bc982017-03-13 16:21:24 +0100262 "snapshot_name": "{{ user `distro` }}-{{ isotime \"200601021504\" }}",
azvyagintsevd8f85232017-10-02 15:30:28 +0300263 "region": "ams2",
264 "size": "1gb"
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100265 }
266 ]
alexz5b795142018-02-13 15:59:28 +0100267}