blob: 6b84cc05d200d3e3188db665cd7a6aec20a796ad [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",
Jakub Josef6bcf3862017-05-03 16:16:39 +020017 "scripts/salt.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030018 "scripts/network.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010019 "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 },
azvyagintsevd8f85232017-10-02 15:30:28 +030036 "qemu": {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010037 "scripts": [
38 "scripts/base.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030039 "scripts/salt.sh",
Jakub Josef6bcf3862017-05-03 16:16:39 +020040 "scripts/network.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010041 "scripts/security.sh",
42 "scripts/cleanup.sh",
43 "scripts/zerodisk.sh"
44 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030045 },
46 "docker": {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010047 "scripts": [
48 "scripts/docker.sh",
49 "scripts/base.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030050 "scripts/salt.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010051 "scripts/cleanup.sh"
52 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030053 },
54 "digitalocean": {
55 "scripts": [
56 "scripts/base.sh",
57 "scripts/salt.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010058 "scripts/security.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030059 "scripts/cleanup.sh"
60 ]
61 }
Filip Pytloun7ae5c752016-01-15 13:48:38 +010062 }
63 },
64 {
65 "type": "file",
alexz5b795142018-02-13 15:59:28 +010066 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010067 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
68 },
69 {
70 "type": "file",
alexz5b795142018-02-13 15:59:28 +010071 "source": "files/etc/cloud/cloud.cfg",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010072 "destination": "/etc/cloud/cloud.cfg"
73 }
74 ],
75 "post-processors": [
76 {
77 "type": "vagrant",
78 "keep_input_artifact": true,
Filip Pytloun451bc982017-03-13 16:21:24 +010079 "output": "images/{{ user `distro` }}-{{.Provider}}-{{ isotime \"200601021504\" }}.box",
azvyagintsevd8f85232017-10-02 15:30:28 +030080 "except": [
81 "digitalocean",
82 "docker"
83 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +010084 },
85 {
86 "type": "docker-tag",
Filip Pytlounc2b0ca02016-06-09 16:26:30 +020087 "repository": "tcpcloud/ubuntu",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010088 "tag": "16.04",
azvyagintsevd8f85232017-10-02 15:30:28 +030089 "only": [
90 "docker"
91 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +010092 },
93 {
94 "type": "docker-save",
Filip Pytloun451bc982017-03-13 16:21:24 +010095 "path": "images/{{ user `distro` }}-docker-{{ isotime \"200601021504\" }}.tar",
azvyagintsevd8f85232017-10-02 15:30:28 +030096 "only": [
97 "docker"
98 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +010099 }
100 ],
101 "builders": [
102 {
103 "type": "virtualbox-iso",
104 "boot_command": [
105 "<esc><wait>",
106 "<esc><wait>",
107 "<enter><wait>",
108 "/install/vmlinuz<wait>",
109 " auto<wait>",
110 " console-setup/ask_detect=false<wait>",
111 " console-setup/layoutcode=us<wait>",
112 " console-setup/modelcode=pc105<wait>",
113 " debconf/frontend=noninteractive<wait>",
114 " debian-installer=en_US<wait>",
115 " fb=false<wait>",
116 " initrd=/install/initrd.gz<wait>",
117 " kbd-chooser/method=us<wait>",
118 " keyboard-configuration/layout=USA<wait>",
119 " keyboard-configuration/variant=USA<wait>",
120 " passwd/root-password={{user `password`}} ",
121 " passwd/root-password-again={{user `password`}} ",
122 " locale=en_US<wait>",
123 " netcfg/get_hostname=ubuntu-1604<wait>",
124 " netcfg/get_domain=cloudlab.cz<wait>",
125 " noapic<wait>",
126 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
127 " -- <wait>",
128 "<enter><wait>"
129 ],
130 "boot_wait": "5s",
131 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun451bc982017-03-13 16:21:24 +0100132 "output_directory": "images/{{ user `distro` }}-vbox-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100133 "guest_os_type": "Ubuntu_64",
134 "http_directory": "http",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200135 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100136 "iso_checksum_type": "md5",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200137 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100138 "ssh_username": "{{user `user`}}",
139 "ssh_password": "{{user `password`}}",
140 "ssh_port": 22,
141 "ssh_wait_timeout": "10000s",
142 "shutdown_command": "shutdown -P now",
143 "headless": true,
144 "vboxmanage": [
azvyagintsevd8f85232017-10-02 15:30:28 +0300145 [
146 "modifyvm",
147 "{{.Name}}",
148 "--memory",
149 "1024"
150 ],
151 [
152 "modifyvm",
153 "{{.Name}}",
154 "--cpus",
155 "2"
156 ],
157 [
158 "modifyvm",
159 "{{.Name}}",
160 "--vrde",
161 "on"
162 ],
163 [
164 "modifyvm",
165 "{{.Name}}",
166 "--vrdeport",
167 "5000-5050"
168 ],
169 [
170 "modifyvm",
171 "{{.Name}}",
172 "--vrdeaddress",
173 "127.0.0.1"
174 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100175 ]
176 },
177 {
178 "type": "vmware-iso",
179 "boot_command": [
180 "<esc><wait>",
181 "<esc><wait>",
182 "<enter><wait>",
183 "/install/vmlinuz<wait>",
184 " auto<wait>",
185 " console-setup/ask_detect=false<wait>",
186 " console-setup/layoutcode=us<wait>",
187 " console-setup/modelcode=pc105<wait>",
188 " debconf/frontend=noninteractive<wait>",
189 " debian-installer=en_US<wait>",
190 " fb=false<wait>",
191 " initrd=/install/initrd.gz<wait>",
192 " kbd-chooser/method=us<wait>",
193 " keyboard-configuration/layout=USA<wait>",
194 " keyboard-configuration/variant=USA<wait>",
195 " passwd/root-password={{user `password`}} ",
196 " passwd/root-password-again={{user `password`}} ",
197 " locale=en_US<wait>",
198 " netcfg/get_hostname=ubuntu-1604<wait>",
199 " netcfg/get_domain=changeme<wait>",
200 " noapic<wait>",
201 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
202 " -- <wait>",
203 "<enter><wait>"
204 ],
205 "boot_wait": "5s",
206 "disk_size": "{{ user `disk_size`}}",
207 "disk_type_id": 4,
208 "vmdk_name": "{{ user `distro`}}",
Filip Pytloun451bc982017-03-13 16:21:24 +0100209 "output_directory": "images/{{ user `distro` }}-vmware-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100210 "guest_os_type": "linux",
211 "http_directory": "http",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200212 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100213 "iso_checksum_type": "md5",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200214 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100215 "ssh_username": "{{user `user`}}",
216 "ssh_password": "{{user `password`}}",
217 "ssh_port": 22,
218 "ssh_wait_timeout": "10000s",
219 "shutdown_command": "shutdown -P now",
220 "vmx_data": {
221 "memsize": "1024",
222 "numvcpus": "1",
223 "cpuid.coresPerSocket": "1"
224 }
225 },
226 {
227 "type": "qemu",
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100228 "qemuargs": [
alexz5b795142018-02-13 15:59:28 +0100229 [ "-m", "1024M" ],
230 [ "-fda", "config-drive/cloudata.iso" ]
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100231 ],
Filip Pytloun451bc982017-03-13 16:21:24 +0100232 "vm_name": "{{ user `distro` }}-{{ isotime \"200601021504\" }}",
233 "output_directory": "images/{{ user `distro` }}-qemu-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100234 "format": "qcow2",
alexz5b795142018-02-13 15:59:28 +0100235 "iso_checksum": "1ba74ef0acade70d8c394308fab8913c",
236 "iso_checksum_type": "md5",
237 "iso_url": "https://cloud-images.ubuntu.com/xenial/20180213.2/xenial-server-cloudimg-amd64-disk1.img",
238 "disk_image": true,
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100239 "accelerator": "kvm",
240 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100241 "headless": true,
242 "ssh_username": "{{user `user`}}",
243 "ssh_password": "{{user `password`}}",
244 "shutdown_command": "shutdown -P now",
245 "boot_wait": "2s",
alexz5b795142018-02-13 15:59:28 +0100246 "ssh_wait_timeout": "360s"
azvyagintsevd8f85232017-10-02 15:30:28 +0300247 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100248 {
249 "type": "docker",
250 "image": "ubuntu:16.04",
251 "commit": true
252 },
253 {
254 "type": "digitalocean",
255 "api_token": "{{user `do_api_token`}}",
256 "image": "{{user `distro`}}",
Filip Pytloun451bc982017-03-13 16:21:24 +0100257 "snapshot_name": "{{ user `distro` }}-{{ isotime \"200601021504\" }}",
azvyagintsevd8f85232017-10-02 15:30:28 +0300258 "region": "ams2",
259 "size": "1gb"
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100260 }
261 ]
alexz5b795142018-02-13 15:59:28 +0100262}