blob: 10f84df54b5b8c0f17838061c148a248e19f8126 [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"
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100104 }
105 ],
106 "post-processors": [
107 {
108 "type": "vagrant",
109 "keep_input_artifact": true,
Jiri Broulik0b211672018-04-11 09:35:47 +0200110 "output": "images/{{ user `image_name` }}-{{.Provider}}-{{ isotime \"200601021504\" }}.box",
azvyagintsevd8f85232017-10-02 15:30:28 +0300111 "except": [
112 "digitalocean",
113 "docker"
114 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100115 },
116 {
117 "type": "docker-tag",
Filip Pytlounc2b0ca02016-06-09 16:26:30 +0200118 "repository": "tcpcloud/ubuntu",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100119 "tag": "16.04",
azvyagintsevd8f85232017-10-02 15:30:28 +0300120 "only": [
121 "docker"
122 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100123 },
124 {
125 "type": "docker-save",
Jiri Broulik0b211672018-04-11 09:35:47 +0200126 "path": "images/{{ user `image_name` }}-docker-{{ isotime \"200601021504\" }}.tar",
azvyagintsevd8f85232017-10-02 15:30:28 +0300127 "only": [
128 "docker"
129 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100130 }
131 ],
132 "builders": [
133 {
134 "type": "virtualbox-iso",
135 "boot_command": [
136 "<esc><wait>",
137 "<esc><wait>",
138 "<enter><wait>",
139 "/install/vmlinuz<wait>",
140 " auto<wait>",
141 " console-setup/ask_detect=false<wait>",
142 " console-setup/layoutcode=us<wait>",
143 " console-setup/modelcode=pc105<wait>",
144 " debconf/frontend=noninteractive<wait>",
145 " debian-installer=en_US<wait>",
146 " fb=false<wait>",
147 " initrd=/install/initrd.gz<wait>",
148 " kbd-chooser/method=us<wait>",
149 " keyboard-configuration/layout=USA<wait>",
150 " keyboard-configuration/variant=USA<wait>",
azvyagintseve1b236a2018-07-13 16:59:49 +0300151 " passwd/root-password={{ user `password` }} ",
152 " passwd/root-password-again={{ user `password` }} ",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100153 " locale=en_US<wait>",
154 " netcfg/get_hostname=ubuntu-1604<wait>",
155 " netcfg/get_domain=cloudlab.cz<wait>",
156 " noapic<wait>",
157 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
158 " -- <wait>",
159 "<enter><wait>"
160 ],
161 "boot_wait": "5s",
162 "disk_size": "{{ user `disk_size`}}",
azvyagintsev8d938882018-08-29 12:36:36 +0300163 "output_directory": "images/{{ user `image_name`}}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100164 "guest_os_type": "Ubuntu_64",
165 "http_directory": "http",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200166 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100167 "iso_checksum_type": "md5",
Jakub Josefa59d0fb2017-09-04 13:26:15 +0200168 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
azvyagintseve1b236a2018-07-13 16:59:49 +0300169 "ssh_username": "{{ user `user` }}",
170 "ssh_password": "{{ user `password` }}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100171 "ssh_port": 22,
172 "ssh_wait_timeout": "10000s",
azvyagintsevdd137842018-07-13 18:13:06 +0300173 "shutdown_command": "shutdown -P now",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100174 "headless": true,
175 "vboxmanage": [
azvyagintsevd8f85232017-10-02 15:30:28 +0300176 [
177 "modifyvm",
178 "{{.Name}}",
179 "--memory",
180 "1024"
181 ],
182 [
183 "modifyvm",
184 "{{.Name}}",
185 "--cpus",
186 "2"
187 ],
188 [
189 "modifyvm",
190 "{{.Name}}",
191 "--vrde",
192 "on"
193 ],
194 [
195 "modifyvm",
196 "{{.Name}}",
197 "--vrdeport",
198 "5000-5050"
199 ],
200 [
201 "modifyvm",
202 "{{.Name}}",
203 "--vrdeaddress",
204 "127.0.0.1"
205 ]
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100206 ]
207 },
208 {
209 "type": "vmware-iso",
210 "boot_command": [
211 "<esc><wait>",
212 "<esc><wait>",
213 "<enter><wait>",
214 "/install/vmlinuz<wait>",
215 " auto<wait>",
216 " console-setup/ask_detect=false<wait>",
217 " console-setup/layoutcode=us<wait>",
218 " console-setup/modelcode=pc105<wait>",
219 " debconf/frontend=noninteractive<wait>",
220 " debian-installer=en_US<wait>",
221 " fb=false<wait>",
222 " initrd=/install/initrd.gz<wait>",
223 " kbd-chooser/method=us<wait>",
224 " keyboard-configuration/layout=USA<wait>",
225 " keyboard-configuration/variant=USA<wait>",
226 " passwd/root-password={{user `password`}} ",
227 " passwd/root-password-again={{user `password`}} ",
228 " locale=en_US<wait>",
229 " netcfg/get_hostname=ubuntu-1604<wait>",
230 " netcfg/get_domain=changeme<wait>",
231 " noapic<wait>",
232 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
233 " -- <wait>",
234 "<enter><wait>"
235 ],
236 "boot_wait": "5s",
237 "disk_size": "{{ user `disk_size`}}",
238 "disk_type_id": 4,
Jiri Broulik0b211672018-04-11 09:35:47 +0200239 "vmdk_name": "{{ user `image_name`}}",
azvyagintsev8d938882018-08-29 12:36:36 +0300240 "output_directory": "images/{{ user `image_name`}}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100241 "guest_os_type": "linux",
242 "http_directory": "http",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200243 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100244 "iso_checksum_type": "md5",
Jakub Josefd65a5fb2017-09-04 16:03:17 +0200245 "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100246 "ssh_username": "{{user `user`}}",
247 "ssh_password": "{{user `password`}}",
248 "ssh_port": 22,
249 "ssh_wait_timeout": "10000s",
azvyagintsevdd137842018-07-13 18:13:06 +0300250 "shutdown_command": "shutdown -P now",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100251 "vmx_data": {
252 "memsize": "1024",
253 "numvcpus": "1",
254 "cpuid.coresPerSocket": "1"
255 }
256 },
257 {
azvyagintsev4053eb22018-03-29 16:21:51 +0300258 "type": "docker",
259 "image": "ubuntu:16.04",
260 "commit": true
261 },
262 {
263 "type": "digitalocean",
264 "api_token": "{{user `do_api_token`}}",
Jiri Broulik0b211672018-04-11 09:35:47 +0200265 "image": "{{user `image_name`}}",
266 "snapshot_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
azvyagintsev4053eb22018-03-29 16:21:51 +0300267 "region": "ams2",
268 "size": "1gb"
269 },
270 {
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100271 "type": "qemu",
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100272 "qemuargs": [
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200273 ["-m", "1024M"],
azvyagintsev262b28c2018-10-23 18:38:42 +0300274 ["-device", "virtio-net,netdev=user.0"],
275 ["-object","rng-random,id=objrng0,filename=/dev/urandom"],
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200276 ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10"]
Filip Pytloun56cf9e32016-02-19 09:56:08 +0100277 ],
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200278 "vm_name": "{{ user `image_name` }}",
279 "output_directory": "images/{{ user `image_name`}}",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100280 "accelerator": "kvm",
281 "disk_size": "{{ user `disk_size`}}",
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200282 "iso_checksum": "24636fd103a2a43c95659f1c3c63718e",
283 "iso_checksum_type": "md5",
284 "iso_url": "http://releases.ubuntu.com/16.04.5/ubuntu-16.04.5-server-amd64.iso",
285 "iso_target_path": "{{ user `images_cache` }}/ubuntu-16.04.5-server-amd64.iso",
286 "http_directory": "http",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100287 "headless": true,
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200288 "ssh_username": "{{user `user`}}",
289 "ssh_password": "{{user `password`}}",
290 "shutdown_command": "sync; sudo /sbin/shutdown -hP now",
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100291 "boot_wait": "2s",
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200292 "ssh_wait_timeout": "700s",
azvyagintsev393dc8e2018-11-19 11:31:26 +0200293 "boot_command": [
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200294 "<enter><wait><f6><esc>",
295 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
296 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
297 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
298 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
299 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
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>",
azvyagintsev393dc8e2018-11-19 11:31:26 +0200304 "/install/vmlinuz<wait>",
305 " auto<wait>",
306 " console-setup/ask_detect=false<wait>",
307 " console-setup/layoutcode=us<wait>",
308 " console-setup/modelcode=pc105<wait>",
309 " debconf/frontend=noninteractive<wait>",
310 " debian-installer=en_US<wait>",
311 " fb=false<wait>",
312 " initrd=/install/initrd.gz<wait>",
313 " kbd-chooser/method=us<wait>",
314 " keyboard-configuration/layout=USA<wait>",
315 " keyboard-configuration/variant=USA<wait>",
316 " passwd/root-password={{ user `password` }} ",
317 " passwd/root-password-again={{ user `password` }} ",
318 " locale=en_US<wait>",
319 " netcfg/get_hostname=ubuntu<wait>",
320 " netcfg/get_domain=local<wait>",
321 " noapic<wait>",
322 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
323 " -- <wait>",
324 "<enter><wait>"
325 ]
azvyagintsevd8f85232017-10-02 15:30:28 +0300326 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100327 {
azvyagintsev4053eb22018-03-29 16:21:51 +0300328 "type": "openstack",
329 "ssh_username": "{{user `user`}}",
330 "ssh_password": "{{user `password`}}",
331 "image_name": "{{user `image_name`}}",
332 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
333 "reuse_ips": "true",
334 "source_image": "{{ user `os_image` }}",
335 "flavor": "{{ user `os_flavor` }}",
336 "user_data_file": "config-drive/user-data.yaml",
337 "tenant_id": "{{ user `os_tenant` }}",
338 "networks": ["{{ user `os_network` }}"],
339 "availability_zone": "{{user `os_zone`}}",
340 "identity_endpoint": "{{user `os_endpoint`}}",
341 "username": "{{user `os_username`}}",
342 "password": "{{user `os_password`}}"
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100343 }
344 ]
alexz5b795142018-02-13 15:59:28 +0100345}