blob: 71e67f39e9ba3fb834a81863a8f64c57a3e2bc88 [file] [log] [blame]
Filip Pytloun7ae5c752016-01-15 13:48:38 +01001{
azvyagintsevd8f85232017-10-02 15:30:28 +03002 "variables": {
3 "user": "root",
azvyagintsevbe158632018-12-13 20:23:52 +02004 "password": "r00tme",
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 ]
azvyagintseve052fbe2018-12-13 22:08:32 +0200135 },
136 {
137 "keep_input_artifact": false,
138 "output": "images/{{ user `image_name` }}.qcow2",
139 "type": "vagrant",
140 "only": [
141 "qemu"
142 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100143 }
144 ],
145 "builders": [
146 {
147 "type": "virtualbox-iso",
148 "boot_command": [
149 "<esc><wait>",
150 "<esc><wait>",
151 "<enter><wait>",
152 "/install/vmlinuz<wait>",
153 " auto<wait>",
154 " console-setup/ask_detect=false<wait>",
155 " console-setup/layoutcode=us<wait>",
156 " console-setup/modelcode=pc105<wait>",
157 " debconf/frontend=noninteractive<wait>",
158 " debian-installer=en_US<wait>",
159 " fb=false<wait>",
160 " initrd=/install/initrd.gz<wait>",
161 " kbd-chooser/method=us<wait>",
162 " keyboard-configuration/layout=USA<wait>",
163 " keyboard-configuration/variant=USA<wait>",
azvyagintseve1b236a2018-07-13 16:59:49 +0300164 " passwd/root-password={{ user `password` }} ",
165 " passwd/root-password-again={{ user `password` }} ",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100166 " locale=en_US<wait>",
azvyagintsevbe158632018-12-13 20:23:52 +0200167 " netcfg/get_hostname=ubuntu<wait>",
168 " netcfg/get_domain=local<wait>",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100169 " noapic<wait>",
170 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
171 " -- <wait>",
172 "<enter><wait>"
173 ],
174 "boot_wait": "5s",
175 "disk_size": "{{ user `disk_size`}}",
azvyagintsev8d938882018-08-29 12:36:36 +0300176 "output_directory": "images/{{ user `image_name`}}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100177 "guest_os_type": "Ubuntu_64",
178 "http_directory": "http",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200179 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100180 "iso_checksum_type": "md5",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200181 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
azvyagintseve1b236a2018-07-13 16:59:49 +0300182 "ssh_username": "{{ user `user` }}",
183 "ssh_password": "{{ user `password` }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100184 "ssh_port": 22,
185 "ssh_wait_timeout": "10000s",
azvyagintsevdd137842018-07-13 18:13:06 +0300186 "shutdown_command": "shutdown -P now",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100187 "headless": true,
188 "vboxmanage": [
azvyagintsevd8f85232017-10-02 15:30:28 +0300189 [
190 "modifyvm",
191 "{{.Name}}",
192 "--memory",
193 "1024"
194 ],
195 [
196 "modifyvm",
197 "{{.Name}}",
198 "--cpus",
199 "2"
200 ],
201 [
202 "modifyvm",
203 "{{.Name}}",
204 "--vrde",
205 "on"
206 ],
207 [
208 "modifyvm",
209 "{{.Name}}",
210 "--vrdeport",
211 "5000-5050"
212 ],
213 [
214 "modifyvm",
215 "{{.Name}}",
216 "--vrdeaddress",
217 "127.0.0.1"
218 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100219 ]
220 },
221 {
222 "type": "vmware-iso",
223 "boot_command": [
224 "<esc><wait>",
225 "<esc><wait>",
226 "<enter><wait>",
227 "/install/vmlinuz<wait>",
228 " auto<wait>",
229 " console-setup/ask_detect=false<wait>",
230 " console-setup/layoutcode=us<wait>",
231 " console-setup/modelcode=pc105<wait>",
232 " debconf/frontend=noninteractive<wait>",
233 " debian-installer=en_US<wait>",
234 " fb=false<wait>",
235 " initrd=/install/initrd.gz<wait>",
236 " kbd-chooser/method=us<wait>",
237 " keyboard-configuration/layout=USA<wait>",
238 " keyboard-configuration/variant=USA<wait>",
239 " passwd/root-password={{user `password`}} ",
240 " passwd/root-password-again={{user `password`}} ",
241 " locale=en_US<wait>",
azvyagintsevbe158632018-12-13 20:23:52 +0200242 " netcfg/get_hostname=ubuntu<wait>",
243 " netcfg/get_domain=local<wait>",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100244 " noapic<wait>",
245 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
246 " -- <wait>",
247 "<enter><wait>"
248 ],
249 "boot_wait": "5s",
250 "disk_size": "{{ user `disk_size`}}",
251 "disk_type_id": 4,
Jiri Broulik0b211672018-04-11 09:35:47 +0200252 "vmdk_name": "{{ user `image_name`}}",
azvyagintsev8d938882018-08-29 12:36:36 +0300253 "output_directory": "images/{{ user `image_name`}}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100254 "guest_os_type": "linux",
255 "http_directory": "http",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200256 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100257 "iso_checksum_type": "md5",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200258 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100259 "ssh_username": "{{user `user`}}",
260 "ssh_password": "{{user `password`}}",
261 "ssh_port": 22,
262 "ssh_wait_timeout": "10000s",
azvyagintsevdd137842018-07-13 18:13:06 +0300263 "shutdown_command": "shutdown -P now",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100264 "vmx_data": {
265 "memsize": "1024",
266 "numvcpus": "1",
267 "cpuid.coresPerSocket": "1"
268 }
269 },
270 {
azvyagintsev4053eb22018-03-29 16:21:51 +0300271 "type": "docker",
272 "image": "ubuntu:16.04",
273 "commit": true
274 },
275 {
276 "type": "digitalocean",
277 "api_token": "{{user `do_api_token`}}",
Jiri Broulik0b211672018-04-11 09:35:47 +0200278 "image": "{{user `image_name`}}",
279 "snapshot_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
azvyagintsev4053eb22018-03-29 16:21:51 +0300280 "region": "ams2",
281 "size": "1gb"
282 },
283 {
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100284 "type": "qemu",
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100285 "qemuargs": [
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200286 ["-m", "1024M"],
azvyagintsev262b28c2018-10-23 18:38:42 +0300287 ["-device", "virtio-net,netdev=user.0"],
288 ["-object","rng-random,id=objrng0,filename=/dev/urandom"],
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200289 ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10"]
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100290 ],
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200291 "vm_name": "{{ user `image_name` }}",
292 "output_directory": "images/{{ user `image_name`}}",
azvyagintsevbe158632018-12-13 20:23:52 +0200293 "boot_key_interval": "50ms",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100294 "accelerator": "kvm",
295 "disk_size": "{{ user `disk_size`}}",
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200296 "iso_checksum": "24636fd103a2a43c95659f1c3c63718e",
297 "iso_checksum_type": "md5",
298 "iso_url": "http://releases.ubuntu.com/16.04.5/ubuntu-16.04.5-server-amd64.iso",
299 "iso_target_path": "{{ user `images_cache` }}/ubuntu-16.04.5-server-amd64.iso",
300 "http_directory": "http",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100301 "headless": true,
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200302 "ssh_username": "{{user `user`}}",
303 "ssh_password": "{{user `password`}}",
304 "shutdown_command": "sync; sudo /sbin/shutdown -hP now",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100305 "boot_wait": "2s",
azvyagintsevbe158632018-12-13 20:23:52 +0200306 "ssh_wait_timeout": "15m",
307 "ssh_host_port_min": 7050,
308 "ssh_host_port_max": 7060,
azvyagintsev393dc8e2018-11-19 11:31:26 +0200309 "boot_command": [
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200310 "<enter><wait><f6><esc>",
311 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
312 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
313 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
314 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
315 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
316 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
317 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
318 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
319 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
azvyagintsev393dc8e2018-11-19 11:31:26 +0200320 "/install/vmlinuz<wait>",
321 " auto<wait>",
322 " console-setup/ask_detect=false<wait>",
323 " console-setup/layoutcode=us<wait>",
324 " console-setup/modelcode=pc105<wait>",
325 " debconf/frontend=noninteractive<wait>",
326 " debian-installer=en_US<wait>",
327 " fb=false<wait>",
328 " initrd=/install/initrd.gz<wait>",
329 " kbd-chooser/method=us<wait>",
330 " keyboard-configuration/layout=USA<wait>",
331 " keyboard-configuration/variant=USA<wait>",
azvyagintsev393dc8e2018-11-19 11:31:26 +0200332 " locale=en_US<wait>",
333 " netcfg/get_hostname=ubuntu<wait>",
334 " netcfg/get_domain=local<wait>",
335 " noapic<wait>",
336 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
337 " -- <wait>",
338 "<enter><wait>"
339 ]
azvyagintsevd8f85232017-10-02 15:30:28 +0300340 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100341 {
azvyagintsev4053eb22018-03-29 16:21:51 +0300342 "type": "openstack",
343 "ssh_username": "{{user `user`}}",
344 "ssh_password": "{{user `password`}}",
345 "image_name": "{{user `image_name`}}",
346 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
347 "reuse_ips": "true",
348 "source_image": "{{ user `os_image` }}",
349 "flavor": "{{ user `os_flavor` }}",
350 "user_data_file": "config-drive/user-data.yaml",
351 "tenant_id": "{{ user `os_tenant` }}",
352 "networks": ["{{ user `os_network` }}"],
353 "availability_zone": "{{user `os_zone`}}",
354 "identity_endpoint": "{{user `os_endpoint`}}",
355 "username": "{{user `os_username`}}",
356 "password": "{{user `os_password`}}"
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100357 }
358 ]
alexz5b795142018-02-13 15:59:28 +0100359}