blob: 3ac29707e71eb7bb2216601c1b601f820db163dc [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",
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +02005 "disk_size": "5000",
azvyagintsev0f697cf2018-06-22 11:44:13 +03006 "images_cache": "{{ env `PACKER_IMAGES_CACHE` }}",
azvyagintsev8d938882018-08-29 12:36:36 +03007 "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}",
Jiri Broulik2ad150e2018-04-19 17:48:55 +02008 "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
9 "saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
azvyagintsev4053eb22018-03-29 16:21:51 +030010 "do_api_token": "{{ env `DO_API_TOKEN` }}",
Jiri Broulik0b211672018-04-11 09:35:47 +020011 "image_name": "{{ env `IMAGE_NAME` }}",
azvyagintsev4053eb22018-03-29 16:21:51 +030012 "os_username": "{{ env `OS_USERNAME` }}",
13 "os_password": "{{ env `OS_PASSWORD` }}",
14 "os_image": "7451fac0-0ce5-4d30-ae36-cd9a90e7948e",
15 "os_endpoint": "https://cloud-cz.bud.mirantis.net:5000/v2.0",
16 "os_zone": "mcp-mk",
17 "os_floating_ip_pool": "public",
18 "os_tenant": "26e4dd19485249608ee3685f254f3909",
19 "os_network": "772f8ca6-1f4a-4535-99d0-880d6ead9a82"
azvyagintsevd8f85232017-10-02 15:30:28 +030020 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +010021 "provisioners": [
22 {
azvyagintsev5a388552018-04-03 21:25:23 +030023 "type": "shell",
24 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
25 "expect_disconnect": "true",
azvyagintsev4053eb22018-03-29 16:21:51 +030026 "environment_vars": [
27 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
azvyagintsev5a388552018-04-03 21:25:23 +030028 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
29 "SALTSTACK_REPO={{ user `saltstack_repo` }}"
azvyagintsev4053eb22018-03-29 16:21:51 +030030 ],
Filip Pytloun7ae5c752016-01-15 13:48:38 +010031 "override": {
32 "virtualbox-iso": {
33 "scripts": [
34 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020035 "scripts/motd.sh",
Jakub Josef6bcf3862017-05-03 16:16:39 +020036 "scripts/salt.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030037 "scripts/network.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010038 "scripts/vagrant.sh",
39 "scripts/virtualbox.sh",
40 "scripts/security.sh",
41 "scripts/cleanup.sh",
42 "scripts/zerodisk.sh"
43 ]
44 },
45 "vmware-iso": {
46 "scripts": [
47 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020048 "scripts/motd.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010049 "scripts/salt.sh",
50 "scripts/vmware.sh",
51 "scripts/security.sh",
52 "scripts/cleanup.sh",
53 "scripts/zerodisk.sh"
54 ]
55 },
azvyagintsevd8f85232017-10-02 15:30:28 +030056 "qemu": {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010057 "scripts": [
58 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020059 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030060 "scripts/salt.sh",
Jakub Josef6bcf3862017-05-03 16:16:39 +020061 "scripts/network.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010062 "scripts/security.sh",
63 "scripts/cleanup.sh",
azvyagintsev1726e802018-06-15 16:55:44 +030064 "scripts/info.sh",
65 "scripts/zerodisk.sh"
Filip Pytloun7ae5c752016-01-15 13:48:38 +010066 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030067 },
azvyagintsev4053eb22018-03-29 16:21:51 +030068 "openstack": {
69 "scripts": [
70 "scripts/base.sh",
71 "scripts/motd.sh",
72 "scripts/salt.sh",
73 "scripts/network.sh",
74 "scripts/security.sh",
75 "scripts/cleanup.sh",
azvyagintsev1726e802018-06-15 16:55:44 +030076 "scripts/info.sh",
77 "scripts/zerodisk.sh"
azvyagintsev4053eb22018-03-29 16:21:51 +030078 ]
79 },
azvyagintsevd8f85232017-10-02 15:30:28 +030080 "docker": {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010081 "scripts": [
82 "scripts/docker.sh",
83 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020084 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030085 "scripts/salt.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010086 "scripts/cleanup.sh"
87 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030088 },
89 "digitalocean": {
90 "scripts": [
91 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020092 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030093 "scripts/salt.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010094 "scripts/security.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030095 "scripts/cleanup.sh"
96 ]
97 }
Filip Pytloun7ae5c752016-01-15 13:48:38 +010098 }
99 },
100 {
101 "type": "file",
Ivan Berezovskiy9f5c7182018-09-06 13:36:25 +0400102 "source": "files/etc/",
103 "destination": "/etc"
Vasyl Saienko59096f22018-11-26 17:26:42 +0200104 },
105 {
106 "type": "file",
107 "source": "files/scripts/",
108 "destination": "/usr/bin"
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100109 }
110 ],
111 "post-processors": [
112 {
113 "type": "vagrant",
114 "keep_input_artifact": true,
Jiri Broulik0b211672018-04-11 09:35:47 +0200115 "output": "images/{{ user `image_name` }}-{{.Provider}}-{{ isotime \"200601021504\" }}.box",
azvyagintsevd8f85232017-10-02 15:30:28 +0300116 "except": [
117 "digitalocean",
118 "docker"
119 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100120 },
121 {
122 "type": "docker-tag",
Filip Pytlounc2b0ca02016-06-09 16:26:30 +0200123 "repository": "tcpcloud/ubuntu",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100124 "tag": "16.04",
azvyagintsevd8f85232017-10-02 15:30:28 +0300125 "only": [
126 "docker"
127 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100128 },
129 {
130 "type": "docker-save",
Jiri Broulik0b211672018-04-11 09:35:47 +0200131 "path": "images/{{ user `image_name` }}-docker-{{ isotime \"200601021504\" }}.tar",
azvyagintsevd8f85232017-10-02 15:30:28 +0300132 "only": [
133 "docker"
134 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100135 }
136 ],
137 "builders": [
138 {
139 "type": "virtualbox-iso",
140 "boot_command": [
141 "<esc><wait>",
142 "<esc><wait>",
143 "<enter><wait>",
144 "/install/vmlinuz<wait>",
145 " auto<wait>",
146 " console-setup/ask_detect=false<wait>",
147 " console-setup/layoutcode=us<wait>",
148 " console-setup/modelcode=pc105<wait>",
149 " debconf/frontend=noninteractive<wait>",
150 " debian-installer=en_US<wait>",
151 " fb=false<wait>",
152 " initrd=/install/initrd.gz<wait>",
153 " kbd-chooser/method=us<wait>",
154 " keyboard-configuration/layout=USA<wait>",
155 " keyboard-configuration/variant=USA<wait>",
azvyagintseve1b236a2018-07-13 16:59:49 +0300156 " passwd/root-password={{ user `password` }} ",
157 " passwd/root-password-again={{ user `password` }} ",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100158 " locale=en_US<wait>",
159 " netcfg/get_hostname=ubuntu-1604<wait>",
160 " netcfg/get_domain=cloudlab.cz<wait>",
161 " noapic<wait>",
162 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
163 " -- <wait>",
164 "<enter><wait>"
165 ],
166 "boot_wait": "5s",
167 "disk_size": "{{ user `disk_size`}}",
azvyagintsev8d938882018-08-29 12:36:36 +0300168 "output_directory": "images/{{ user `image_name`}}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100169 "guest_os_type": "Ubuntu_64",
170 "http_directory": "http",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200171 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100172 "iso_checksum_type": "md5",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200173 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
azvyagintseve1b236a2018-07-13 16:59:49 +0300174 "ssh_username": "{{ user `user` }}",
175 "ssh_password": "{{ user `password` }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100176 "ssh_port": 22,
177 "ssh_wait_timeout": "10000s",
azvyagintsevdd137842018-07-13 18:13:06 +0300178 "shutdown_command": "shutdown -P now",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100179 "headless": true,
180 "vboxmanage": [
azvyagintsevd8f85232017-10-02 15:30:28 +0300181 [
182 "modifyvm",
183 "{{.Name}}",
184 "--memory",
185 "1024"
186 ],
187 [
188 "modifyvm",
189 "{{.Name}}",
190 "--cpus",
191 "2"
192 ],
193 [
194 "modifyvm",
195 "{{.Name}}",
196 "--vrde",
197 "on"
198 ],
199 [
200 "modifyvm",
201 "{{.Name}}",
202 "--vrdeport",
203 "5000-5050"
204 ],
205 [
206 "modifyvm",
207 "{{.Name}}",
208 "--vrdeaddress",
209 "127.0.0.1"
210 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100211 ]
212 },
213 {
214 "type": "vmware-iso",
215 "boot_command": [
216 "<esc><wait>",
217 "<esc><wait>",
218 "<enter><wait>",
219 "/install/vmlinuz<wait>",
220 " auto<wait>",
221 " console-setup/ask_detect=false<wait>",
222 " console-setup/layoutcode=us<wait>",
223 " console-setup/modelcode=pc105<wait>",
224 " debconf/frontend=noninteractive<wait>",
225 " debian-installer=en_US<wait>",
226 " fb=false<wait>",
227 " initrd=/install/initrd.gz<wait>",
228 " kbd-chooser/method=us<wait>",
229 " keyboard-configuration/layout=USA<wait>",
230 " keyboard-configuration/variant=USA<wait>",
231 " passwd/root-password={{user `password`}} ",
232 " passwd/root-password-again={{user `password`}} ",
233 " locale=en_US<wait>",
234 " netcfg/get_hostname=ubuntu-1604<wait>",
235 " netcfg/get_domain=changeme<wait>",
236 " noapic<wait>",
237 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
238 " -- <wait>",
239 "<enter><wait>"
240 ],
241 "boot_wait": "5s",
242 "disk_size": "{{ user `disk_size`}}",
243 "disk_type_id": 4,
Jiri Broulik0b211672018-04-11 09:35:47 +0200244 "vmdk_name": "{{ user `image_name`}}",
azvyagintsev8d938882018-08-29 12:36:36 +0300245 "output_directory": "images/{{ user `image_name`}}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100246 "guest_os_type": "linux",
247 "http_directory": "http",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200248 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100249 "iso_checksum_type": "md5",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200250 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100251 "ssh_username": "{{user `user`}}",
252 "ssh_password": "{{user `password`}}",
253 "ssh_port": 22,
254 "ssh_wait_timeout": "10000s",
azvyagintsevdd137842018-07-13 18:13:06 +0300255 "shutdown_command": "shutdown -P now",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100256 "vmx_data": {
257 "memsize": "1024",
258 "numvcpus": "1",
259 "cpuid.coresPerSocket": "1"
260 }
261 },
262 {
azvyagintsev4053eb22018-03-29 16:21:51 +0300263 "type": "docker",
264 "image": "ubuntu:16.04",
265 "commit": true
266 },
267 {
268 "type": "digitalocean",
269 "api_token": "{{user `do_api_token`}}",
Jiri Broulik0b211672018-04-11 09:35:47 +0200270 "image": "{{user `image_name`}}",
271 "snapshot_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
azvyagintsev4053eb22018-03-29 16:21:51 +0300272 "region": "ams2",
273 "size": "1gb"
274 },
275 {
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100276 "type": "qemu",
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100277 "qemuargs": [
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200278 ["-m", "1024M"],
azvyagintsev262b28c2018-10-23 18:38:42 +0300279 ["-device", "virtio-net,netdev=user.0"],
280 ["-object","rng-random,id=objrng0,filename=/dev/urandom"],
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200281 ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10"]
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100282 ],
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200283 "vm_name": "{{ user `image_name` }}",
284 "output_directory": "images/{{ user `image_name`}}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100285 "accelerator": "kvm",
286 "disk_size": "{{ user `disk_size`}}",
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200287 "iso_checksum": "24636fd103a2a43c95659f1c3c63718e",
288 "iso_checksum_type": "md5",
289 "iso_url": "http://releases.ubuntu.com/16.04.5/ubuntu-16.04.5-server-amd64.iso",
290 "iso_target_path": "{{ user `images_cache` }}/ubuntu-16.04.5-server-amd64.iso",
291 "http_directory": "http",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100292 "headless": true,
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200293 "ssh_username": "{{user `user`}}",
294 "ssh_password": "{{user `password`}}",
295 "shutdown_command": "sync; sudo /sbin/shutdown -hP now",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100296 "boot_wait": "2s",
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200297 "ssh_wait_timeout": "700s",
azvyagintsev393dc8e2018-11-19 11:31:26 +0200298 "boot_command": [
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200299 "<enter><wait><f6><esc>",
300 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
301 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
302 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
303 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
304 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
305 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
306 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
307 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
308 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
azvyagintsev393dc8e2018-11-19 11:31:26 +0200309 "/install/vmlinuz<wait>",
310 " auto<wait>",
311 " console-setup/ask_detect=false<wait>",
312 " console-setup/layoutcode=us<wait>",
313 " console-setup/modelcode=pc105<wait>",
314 " debconf/frontend=noninteractive<wait>",
315 " debian-installer=en_US<wait>",
316 " fb=false<wait>",
317 " initrd=/install/initrd.gz<wait>",
318 " kbd-chooser/method=us<wait>",
319 " keyboard-configuration/layout=USA<wait>",
320 " keyboard-configuration/variant=USA<wait>",
321 " passwd/root-password={{ user `password` }} ",
322 " passwd/root-password-again={{ user `password` }} ",
323 " locale=en_US<wait>",
324 " netcfg/get_hostname=ubuntu<wait>",
325 " netcfg/get_domain=local<wait>",
326 " noapic<wait>",
327 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
328 " -- <wait>",
329 "<enter><wait>"
330 ]
azvyagintsevd8f85232017-10-02 15:30:28 +0300331 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100332 {
azvyagintsev4053eb22018-03-29 16:21:51 +0300333 "type": "openstack",
334 "ssh_username": "{{user `user`}}",
335 "ssh_password": "{{user `password`}}",
336 "image_name": "{{user `image_name`}}",
337 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
338 "reuse_ips": "true",
339 "source_image": "{{ user `os_image` }}",
340 "flavor": "{{ user `os_flavor` }}",
341 "user_data_file": "config-drive/user-data.yaml",
342 "tenant_id": "{{ user `os_tenant` }}",
343 "networks": ["{{ user `os_network` }}"],
344 "availability_zone": "{{user `os_zone`}}",
345 "identity_endpoint": "{{user `os_endpoint`}}",
346 "username": "{{user `os_username`}}",
347 "password": "{{user `os_password`}}"
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100348 }
349 ]
alexz5b795142018-02-13 15:59:28 +0100350}