blob: 284237edb4ead9f9c9b5a61071f8a16ae68e1b4b [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",
azvyagintsevd8f85232017-10-02 15:30:28 +03005 "distro": "ubuntu-16-04-x64",
azvyagintsev4053eb22018-03-29 16:21:51 +03006 "disk_size": "8000",
azvyagintsev0f697cf2018-06-22 11:44:13 +03007 "images_cache": "{{ env `PACKER_IMAGES_CACHE` }}",
azvyagintsev5a388552018-04-03 21:25:23 +03008 "ubuntu_baseurl": "https://mirror.mirantis.com/proposed/ubuntu/",
Jiri Broulik2ad150e2018-04-19 17:48:55 +02009 "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
10 "saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
azvyagintsev4053eb22018-03-29 16:21:51 +030011 "do_api_token": "{{ env `DO_API_TOKEN` }}",
Jiri Broulik0b211672018-04-11 09:35:47 +020012 "image_name": "{{ env `IMAGE_NAME` }}",
azvyagintsev4053eb22018-03-29 16:21:51 +030013 "os_username": "{{ env `OS_USERNAME` }}",
14 "os_password": "{{ env `OS_PASSWORD` }}",
15 "os_image": "7451fac0-0ce5-4d30-ae36-cd9a90e7948e",
16 "os_endpoint": "https://cloud-cz.bud.mirantis.net:5000/v2.0",
17 "os_zone": "mcp-mk",
18 "os_floating_ip_pool": "public",
19 "os_tenant": "26e4dd19485249608ee3685f254f3909",
20 "os_network": "772f8ca6-1f4a-4535-99d0-880d6ead9a82"
azvyagintsevd8f85232017-10-02 15:30:28 +030021 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +010022 "provisioners": [
23 {
azvyagintsev5a388552018-04-03 21:25:23 +030024 "type": "shell",
25 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
26 "expect_disconnect": "true",
azvyagintsev4053eb22018-03-29 16:21:51 +030027 "environment_vars": [
28 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
azvyagintsev5a388552018-04-03 21:25:23 +030029 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
30 "SALTSTACK_REPO={{ user `saltstack_repo` }}"
azvyagintsev4053eb22018-03-29 16:21:51 +030031 ],
Filip Pytloun7ae5c752016-01-15 13:48:38 +010032 "override": {
33 "virtualbox-iso": {
34 "scripts": [
35 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020036 "scripts/motd.sh",
Jakub Josef6bcf3862017-05-03 16:16:39 +020037 "scripts/salt.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030038 "scripts/network.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010039 "scripts/vagrant.sh",
40 "scripts/virtualbox.sh",
41 "scripts/security.sh",
42 "scripts/cleanup.sh",
43 "scripts/zerodisk.sh"
44 ]
45 },
46 "vmware-iso": {
47 "scripts": [
48 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020049 "scripts/motd.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010050 "scripts/salt.sh",
51 "scripts/vmware.sh",
52 "scripts/security.sh",
53 "scripts/cleanup.sh",
54 "scripts/zerodisk.sh"
55 ]
56 },
azvyagintsevd8f85232017-10-02 15:30:28 +030057 "qemu": {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010058 "scripts": [
59 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020060 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030061 "scripts/salt.sh",
Jakub Josef6bcf3862017-05-03 16:16:39 +020062 "scripts/network.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010063 "scripts/security.sh",
64 "scripts/cleanup.sh",
azvyagintsev1726e802018-06-15 16:55:44 +030065 "scripts/info.sh",
66 "scripts/zerodisk.sh"
Filip Pytloun7ae5c752016-01-15 13:48:38 +010067 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030068 },
azvyagintsev4053eb22018-03-29 16:21:51 +030069 "openstack": {
70 "scripts": [
71 "scripts/base.sh",
72 "scripts/motd.sh",
73 "scripts/salt.sh",
74 "scripts/network.sh",
75 "scripts/security.sh",
76 "scripts/cleanup.sh",
azvyagintsev1726e802018-06-15 16:55:44 +030077 "scripts/info.sh",
78 "scripts/zerodisk.sh"
azvyagintsev4053eb22018-03-29 16:21:51 +030079 ]
80 },
azvyagintsevd8f85232017-10-02 15:30:28 +030081 "docker": {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010082 "scripts": [
83 "scripts/docker.sh",
84 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020085 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030086 "scripts/salt.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010087 "scripts/cleanup.sh"
88 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030089 },
90 "digitalocean": {
91 "scripts": [
92 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020093 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030094 "scripts/salt.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010095 "scripts/security.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030096 "scripts/cleanup.sh"
97 ]
98 }
Filip Pytloun7ae5c752016-01-15 13:48:38 +010099 }
100 },
101 {
102 "type": "file",
alexz5b795142018-02-13 15:59:28 +0100103 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100104 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
105 },
106 {
107 "type": "file",
alexz5b795142018-02-13 15:59:28 +0100108 "source": "files/etc/cloud/cloud.cfg",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100109 "destination": "/etc/cloud/cloud.cfg"
110 }
111 ],
112 "post-processors": [
113 {
114 "type": "vagrant",
115 "keep_input_artifact": true,
Jiri Broulik0b211672018-04-11 09:35:47 +0200116 "output": "images/{{ user `image_name` }}-{{.Provider}}-{{ isotime \"200601021504\" }}.box",
azvyagintsevd8f85232017-10-02 15:30:28 +0300117 "except": [
118 "digitalocean",
119 "docker"
120 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100121 },
122 {
123 "type": "docker-tag",
Filip Pytlounc2b0ca02016-06-09 16:26:30 +0200124 "repository": "tcpcloud/ubuntu",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100125 "tag": "16.04",
azvyagintsevd8f85232017-10-02 15:30:28 +0300126 "only": [
127 "docker"
128 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100129 },
130 {
131 "type": "docker-save",
Jiri Broulik0b211672018-04-11 09:35:47 +0200132 "path": "images/{{ user `image_name` }}-docker-{{ isotime \"200601021504\" }}.tar",
azvyagintsevd8f85232017-10-02 15:30:28 +0300133 "only": [
134 "docker"
135 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100136 }
137 ],
138 "builders": [
139 {
140 "type": "virtualbox-iso",
141 "boot_command": [
142 "<esc><wait>",
143 "<esc><wait>",
144 "<enter><wait>",
145 "/install/vmlinuz<wait>",
146 " auto<wait>",
147 " console-setup/ask_detect=false<wait>",
148 " console-setup/layoutcode=us<wait>",
149 " console-setup/modelcode=pc105<wait>",
150 " debconf/frontend=noninteractive<wait>",
151 " debian-installer=en_US<wait>",
152 " fb=false<wait>",
153 " initrd=/install/initrd.gz<wait>",
154 " kbd-chooser/method=us<wait>",
155 " keyboard-configuration/layout=USA<wait>",
156 " keyboard-configuration/variant=USA<wait>",
157 " passwd/root-password={{user `password`}} ",
158 " passwd/root-password-again={{user `password`}} ",
159 " locale=en_US<wait>",
160 " netcfg/get_hostname=ubuntu-1604<wait>",
161 " netcfg/get_domain=cloudlab.cz<wait>",
162 " noapic<wait>",
163 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
164 " -- <wait>",
165 "<enter><wait>"
166 ],
167 "boot_wait": "5s",
168 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun451bc982017-03-13 16:21:24 +0100169 "output_directory": "images/{{ user `distro` }}-vbox-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100170 "guest_os_type": "Ubuntu_64",
171 "http_directory": "http",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200172 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100173 "iso_checksum_type": "md5",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200174 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100175 "ssh_username": "{{user `user`}}",
176 "ssh_password": "{{user `password`}}",
177 "ssh_port": 22,
178 "ssh_wait_timeout": "10000s",
179 "shutdown_command": "shutdown -P now",
180 "headless": true,
181 "vboxmanage": [
azvyagintsevd8f85232017-10-02 15:30:28 +0300182 [
183 "modifyvm",
184 "{{.Name}}",
185 "--memory",
186 "1024"
187 ],
188 [
189 "modifyvm",
190 "{{.Name}}",
191 "--cpus",
192 "2"
193 ],
194 [
195 "modifyvm",
196 "{{.Name}}",
197 "--vrde",
198 "on"
199 ],
200 [
201 "modifyvm",
202 "{{.Name}}",
203 "--vrdeport",
204 "5000-5050"
205 ],
206 [
207 "modifyvm",
208 "{{.Name}}",
209 "--vrdeaddress",
210 "127.0.0.1"
211 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100212 ]
213 },
214 {
215 "type": "vmware-iso",
216 "boot_command": [
217 "<esc><wait>",
218 "<esc><wait>",
219 "<enter><wait>",
220 "/install/vmlinuz<wait>",
221 " auto<wait>",
222 " console-setup/ask_detect=false<wait>",
223 " console-setup/layoutcode=us<wait>",
224 " console-setup/modelcode=pc105<wait>",
225 " debconf/frontend=noninteractive<wait>",
226 " debian-installer=en_US<wait>",
227 " fb=false<wait>",
228 " initrd=/install/initrd.gz<wait>",
229 " kbd-chooser/method=us<wait>",
230 " keyboard-configuration/layout=USA<wait>",
231 " keyboard-configuration/variant=USA<wait>",
232 " passwd/root-password={{user `password`}} ",
233 " passwd/root-password-again={{user `password`}} ",
234 " locale=en_US<wait>",
235 " netcfg/get_hostname=ubuntu-1604<wait>",
236 " netcfg/get_domain=changeme<wait>",
237 " noapic<wait>",
238 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
239 " -- <wait>",
240 "<enter><wait>"
241 ],
242 "boot_wait": "5s",
243 "disk_size": "{{ user `disk_size`}}",
244 "disk_type_id": 4,
Jiri Broulik0b211672018-04-11 09:35:47 +0200245 "vmdk_name": "{{ user `image_name`}}",
Filip Pytloun451bc982017-03-13 16:21:24 +0100246 "output_directory": "images/{{ user `distro` }}-vmware-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100247 "guest_os_type": "linux",
248 "http_directory": "http",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200249 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100250 "iso_checksum_type": "md5",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200251 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100252 "ssh_username": "{{user `user`}}",
253 "ssh_password": "{{user `password`}}",
254 "ssh_port": 22,
255 "ssh_wait_timeout": "10000s",
256 "shutdown_command": "shutdown -P now",
257 "vmx_data": {
258 "memsize": "1024",
259 "numvcpus": "1",
260 "cpuid.coresPerSocket": "1"
261 }
262 },
263 {
azvyagintsev4053eb22018-03-29 16:21:51 +0300264 "type": "docker",
265 "image": "ubuntu:16.04",
266 "commit": true
267 },
268 {
269 "type": "digitalocean",
270 "api_token": "{{user `do_api_token`}}",
Jiri Broulik0b211672018-04-11 09:35:47 +0200271 "image": "{{user `image_name`}}",
272 "snapshot_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
azvyagintsev4053eb22018-03-29 16:21:51 +0300273 "region": "ams2",
274 "size": "1gb"
275 },
276 {
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100277 "type": "qemu",
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100278 "qemuargs": [
alexz5b795142018-02-13 15:59:28 +0100279 [ "-m", "1024M" ],
280 [ "-fda", "config-drive/cloudata.iso" ]
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100281 ],
azvyagintsev4053eb22018-03-29 16:21:51 +0300282 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
283 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100284 "format": "qcow2",
Richard Felkla5a44262018-03-12 15:11:32 +0100285 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
alexz5b795142018-02-13 15:59:28 +0100286 "iso_checksum_type": "md5",
alexz8c4cfc72018-03-23 13:56:10 +0100287 "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img",
azvyagintsev0f697cf2018-06-22 11:44:13 +0300288 "iso_target_path": "{{ user `images_cache`}}/release-20180306_xenial-server-cloudimg-amd64-disk1.img",
alexz5b795142018-02-13 15:59:28 +0100289 "disk_image": true,
azvyagintsev0adfe682018-06-13 16:29:40 +0300290 "disk_compression": true,
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100291 "accelerator": "kvm",
292 "disk_size": "{{ user `disk_size`}}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100293 "headless": true,
294 "ssh_username": "{{user `user`}}",
295 "ssh_password": "{{user `password`}}",
azvyagintsev0adfe682018-06-13 16:29:40 +0300296 "ssh_host_port_min": 7000,
297 "ssh_host_port_max": 7050,
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100298 "shutdown_command": "shutdown -P now",
299 "boot_wait": "2s",
alexz5b795142018-02-13 15:59:28 +0100300 "ssh_wait_timeout": "360s"
azvyagintsevd8f85232017-10-02 15:30:28 +0300301 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100302 {
azvyagintsev4053eb22018-03-29 16:21:51 +0300303 "type": "openstack",
304 "ssh_username": "{{user `user`}}",
305 "ssh_password": "{{user `password`}}",
306 "image_name": "{{user `image_name`}}",
307 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
308 "reuse_ips": "true",
309 "source_image": "{{ user `os_image` }}",
310 "flavor": "{{ user `os_flavor` }}",
311 "user_data_file": "config-drive/user-data.yaml",
312 "tenant_id": "{{ user `os_tenant` }}",
313 "networks": ["{{ user `os_network` }}"],
314 "availability_zone": "{{user `os_zone`}}",
315 "identity_endpoint": "{{user `os_endpoint`}}",
316 "username": "{{user `os_username`}}",
317 "password": "{{user `os_password`}}"
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100318 }
319 ]
alexz5b795142018-02-13 15:59:28 +0100320}