blob: 76d130991da86cd18351504d1329a96ff71248a3 [file] [log] [blame]
jan kaufmana519d7b2015-03-04 00:51:47 +01001{
azvyagintsevd8f85232017-10-02 15:30:28 +03002 "variables": {
3 "user": "root",
azvyagintseve1b236a2018-07-13 16:59:49 +03004 "password": "r00tme",
azvyagintsevd8f85232017-10-02 15:30:28 +03005 "distro": "ubuntu-14-04-x64",
azvyagintseve1b236a2018-07-13 16:59:49 +03006 "disk_size": "8000",
7 "images_cache": "{{ env `PACKER_IMAGES_CACHE` }}",
8 "ubuntu_baseurl": "https://mirror.mirantis.com/proposed/ubuntu/",
9 "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
10 "saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
11 "do_api_token": "{{ env `DO_API_TOKEN` }}",
Jiri Broulik0b211672018-04-11 09:35:47 +020012 "image_name": "{{ env `IMAGE_NAME` }}",
azvyagintseve1b236a2018-07-13 16:59:49 +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 },
jan kaufmana519d7b2015-03-04 00:51:47 +010022 "provisioners": [
23 {
24 "type": "shell",
azvyagintseve1b236a2018-07-13 16:59:49 +030025 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
26 "expect_disconnect": "true",
27 "environment_vars": [
28 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
29 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
30 "SALTSTACK_REPO={{ user `saltstack_repo` }}"
31 ],
jan kaufmana519d7b2015-03-04 00:51:47 +010032 "override": {
33 "virtualbox-iso": {
34 "scripts": [
35 "scripts/base.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030036 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030037 "scripts/salt.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030038 "scripts/network.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010039 "scripts/vagrant.sh",
40 "scripts/virtualbox.sh",
Filip Pytloun896f37b2015-06-25 18:35:42 +020041 "scripts/security.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010042 "scripts/cleanup.sh",
43 "scripts/zerodisk.sh"
44 ]
45 },
46 "vmware-iso": {
47 "scripts": [
48 "scripts/base.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030049 "scripts/motd.sh",
jan kaufmandfc08f02015-04-29 20:17:55 +020050 "scripts/salt.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010051 "scripts/vmware.sh",
Filip Pytloun896f37b2015-06-25 18:35:42 +020052 "scripts/security.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010053 "scripts/cleanup.sh",
54 "scripts/zerodisk.sh"
55 ]
56 },
azvyagintsevd8f85232017-10-02 15:30:28 +030057 "qemu": {
jan kaufmana519d7b2015-03-04 00:51:47 +010058 "scripts": [
59 "scripts/base.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030060 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030061 "scripts/salt.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030062 "scripts/network.sh",
Filip Pytloun896f37b2015-06-25 18:35:42 +020063 "scripts/security.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010064 "scripts/cleanup.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030065 "scripts/info.sh",
66 "scripts/zerodisk.sh"
67 ]
68 },
69 "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",
77 "scripts/info.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010078 "scripts/zerodisk.sh"
79 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030080 },
81 "docker": {
Filip Pytloun7b48fd22015-06-30 23:34:01 +020082 "scripts": [
83 "scripts/docker.sh",
84 "scripts/base.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030085 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030086 "scripts/salt.sh",
Filip Pytloun7b48fd22015-06-30 23:34:01 +020087 "scripts/cleanup.sh"
88 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030089 },
90 "digitalocean": {
91 "scripts": [
92 "scripts/base.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030093 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030094 "scripts/salt.sh",
Filip Pytloun896f37b2015-06-25 18:35:42 +020095 "scripts/security.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030096 "scripts/cleanup.sh"
97 ]
98 }
jan kaufmana519d7b2015-03-04 00:51:47 +010099 }
jan kaufman0fcf1a72015-05-06 10:16:12 +0200100 },
101 {
102 "type": "file",
azvyagintseve1b236a2018-07-13 16:59:49 +0300103 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
jan kaufman0fcf1a72015-05-06 10:16:12 +0200104 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
Filip Pytloun60411d12015-06-25 21:14:41 +0200105 },
106 {
107 "type": "file",
azvyagintseve1b236a2018-07-13 16:59:49 +0300108 "source": "files/etc/cloud/cloud.cfg",
Filip Pytloun60411d12015-06-25 21:14:41 +0200109 "destination": "/etc/cloud/cloud.cfg"
jan kaufmana519d7b2015-03-04 00:51:47 +0100110 }
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 Pytloun7b48fd22015-06-30 23:34:01 +0200121 },
122 {
Filip Pytloun6e4c3b72015-07-23 09:20:13 +0200123 "type": "docker-tag",
Filip Pytlounc2b0ca02016-06-09 16:26:30 +0200124 "repository": "tcpcloud/ubuntu",
Filip Pytloun6e4c3b72015-07-23 09:20:13 +0200125 "tag": "14.04",
azvyagintsevd8f85232017-10-02 15:30:28 +0300126 "only": [
127 "docker"
128 ]
Filip Pytloun6e4c3b72015-07-23 09:20:13 +0200129 },
130 {
Filip Pytloun62c8f832015-07-22 17:40:00 +0200131 "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 ]
jan kaufmana519d7b2015-03-04 00:51:47 +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>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200157 " passwd/root-password={{user `password`}} ",
158 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100159 " locale=en_US<wait>",
160 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufmandfc08f02015-04-29 20:17:55 +0200161 " netcfg/get_domain=cloudlab.cz<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100162 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200163 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100164 " -- <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\" }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100170 "guest_os_type": "Ubuntu_64",
171 "http_directory": "http",
azvyagintseve1b236a2018-07-13 16:59:49 +0300172 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
jan kaufmana519d7b2015-03-04 00:51:47 +0100173 "iso_checksum_type": "md5",
azvyagintseve1b236a2018-07-13 16:59:49 +0300174 "iso_url": "http://releases.ubuntu.com/14.04/ubuntu-14.04.3-server-amd64.iso",
jan kaufmana519d7b2015-03-04 00:51:47 +0100175 "ssh_username": "{{user `user`}}",
176 "ssh_password": "{{user `password`}}",
177 "ssh_port": 22,
178 "ssh_wait_timeout": "10000s",
azvyagintseve1b236a2018-07-13 16:59:49 +0300179 "shutdown_command": "pgrep -f 'sshd: root@' | xargs kill -9 ; shutdown -P now",
Filip Pytloun019c5d42015-07-22 18:59:15 +0200180 "headless": true,
jan kaufmana519d7b2015-03-04 00:51:47 +0100181 "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 ]
jan kaufmana519d7b2015-03-04 00:51:47 +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>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200232 " passwd/root-password={{user `password`}} ",
233 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100234 " locale=en_US<wait>",
235 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100236 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100237 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200238 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100239 " -- <wait>",
240 "<enter><wait>"
241 ],
242 "boot_wait": "5s",
243 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200244 "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\" }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100247 "guest_os_type": "linux",
248 "http_directory": "http",
azvyagintseve1b236a2018-07-13 16:59:49 +0300249 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
jan kaufmana519d7b2015-03-04 00:51:47 +0100250 "iso_checksum_type": "md5",
azvyagintseve1b236a2018-07-13 16:59:49 +0300251 "iso_url": "http://releases.ubuntu.com/14.04/ubuntu-14.04.3-server-amd64.iso",
jan kaufmana519d7b2015-03-04 00:51:47 +0100252 "ssh_username": "{{user `user`}}",
253 "ssh_password": "{{user `password`}}",
254 "ssh_port": 22,
255 "ssh_wait_timeout": "10000s",
azvyagintseve1b236a2018-07-13 16:59:49 +0300256 "shutdown_command": "pgrep -f 'sshd: root@' | xargs kill -9 ; shutdown -P now",
jan kaufmana519d7b2015-03-04 00:51:47 +0100257 "vmx_data": {
jan kaufmandfc08f02015-04-29 20:17:55 +0200258 "memsize": "1024",
jan kaufmana519d7b2015-03-04 00:51:47 +0100259 "numvcpus": "1",
260 "cpuid.coresPerSocket": "1"
261 }
262 },
263 {
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200264 "type": "docker",
265 "image": "ubuntu:14.04",
266 "commit": true
Filip Pytloun896f37b2015-06-25 18:35:42 +0200267 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200268 {
jan kaufmana519d7b2015-03-04 00:51:47 +0100269 "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\" }}",
azvyagintsevd8f85232017-10-02 15:30:28 +0300273 "region": "ams2",
274 "size": "1gb"
azvyagintseve1b236a2018-07-13 16:59:49 +0300275 },
276 {
277 "type": "qemu",
278 "qemuargs": [
279 [ "-m", "1024M" ],
280 [ "-cdrom", "config-drive/cloudata.iso" ]
281 ],
282 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
283 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
284 "format": "qcow2",
285 "iso_checksum": "06d561ab1ae8723493b484c1effc2790",
286 "iso_checksum_type": "md5",
287 "iso_url": "http://cloud-images.ubuntu.com/releases/trusty/release-20180703/ubuntu-14.04-server-cloudimg-amd64-disk1.img",
288 "iso_target_path": "{{ user `images_cache`}}/release-20180703_ubuntu-14.04-server-cloudimg-amd64-disk1.img",
289 "disk_image": true,
290 "disk_compression": true,
291 "accelerator": "kvm",
292 "disk_size": "{{ user `disk_size`}}",
293 "headless": true,
294 "ssh_username": "{{ user `user` }}",
295 "ssh_password": "{{ user `password` }}",
296 "ssh_host_port_min": 7000,
297 "ssh_host_port_max": 7050,
298 "shutdown_command": "pgrep -f 'sshd: root@' | xargs kill -9 ; shutdown -P now",
299 "boot_wait": "2s",
300 "ssh_wait_timeout": "360s"
301 },
302 {
303 "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`}}"
jan kaufmana519d7b2015-03-04 00:51:47 +0100318 }
319 ]
azvyagintseve1b236a2018-07-13 16:59:49 +0300320}