blob: dd3f14f4ce9c72311e1de03da9129b4c0bc08612 [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",
azvyagintseve1b236a2018-07-13 16:59:49 +03005 "disk_size": "8000",
6 "images_cache": "{{ env `PACKER_IMAGES_CACHE` }}",
azvyagintsev8d938882018-08-29 12:36:36 +03007 "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}",
azvyagintseve1b236a2018-07-13 16:59:49 +03008 "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
9 "saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
10 "do_api_token": "{{ env `DO_API_TOKEN` }}",
Jiri Broulik0b211672018-04-11 09:35:47 +020011 "image_name": "{{ env `IMAGE_NAME` }}",
azvyagintseve1b236a2018-07-13 16:59:49 +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 },
jan kaufmana519d7b2015-03-04 00:51:47 +010021 "provisioners": [
22 {
23 "type": "shell",
azvyagintseve1b236a2018-07-13 16:59:49 +030024 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
25 "expect_disconnect": "true",
26 "environment_vars": [
27 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
28 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
29 "SALTSTACK_REPO={{ user `saltstack_repo` }}"
30 ],
jan kaufmana519d7b2015-03-04 00:51:47 +010031 "override": {
32 "virtualbox-iso": {
33 "scripts": [
34 "scripts/base.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030035 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030036 "scripts/salt.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030037 "scripts/network.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010038 "scripts/vagrant.sh",
39 "scripts/virtualbox.sh",
Filip Pytloun896f37b2015-06-25 18:35:42 +020040 "scripts/security.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010041 "scripts/cleanup.sh",
42 "scripts/zerodisk.sh"
43 ]
44 },
45 "vmware-iso": {
46 "scripts": [
47 "scripts/base.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030048 "scripts/motd.sh",
jan kaufmandfc08f02015-04-29 20:17:55 +020049 "scripts/salt.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010050 "scripts/vmware.sh",
Filip Pytloun896f37b2015-06-25 18:35:42 +020051 "scripts/security.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010052 "scripts/cleanup.sh",
53 "scripts/zerodisk.sh"
54 ]
55 },
azvyagintsevd8f85232017-10-02 15:30:28 +030056 "qemu": {
jan kaufmana519d7b2015-03-04 00:51:47 +010057 "scripts": [
58 "scripts/base.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030059 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030060 "scripts/salt.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030061 "scripts/network.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010062 "scripts/cleanup.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030063 "scripts/info.sh",
azvyagintsevc975d9e2018-07-17 20:27:39 +030064 "scripts/security.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030065 "scripts/zerodisk.sh"
66 ]
67 },
68 "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",
76 "scripts/info.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010077 "scripts/zerodisk.sh"
78 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030079 },
80 "docker": {
Filip Pytloun7b48fd22015-06-30 23:34:01 +020081 "scripts": [
82 "scripts/docker.sh",
83 "scripts/base.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030084 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030085 "scripts/salt.sh",
Filip Pytloun7b48fd22015-06-30 23:34:01 +020086 "scripts/cleanup.sh"
87 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030088 },
89 "digitalocean": {
90 "scripts": [
91 "scripts/base.sh",
azvyagintseve1b236a2018-07-13 16:59:49 +030092 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030093 "scripts/salt.sh",
Filip Pytloun896f37b2015-06-25 18:35:42 +020094 "scripts/security.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030095 "scripts/cleanup.sh"
96 ]
97 }
jan kaufmana519d7b2015-03-04 00:51:47 +010098 }
jan kaufman0fcf1a72015-05-06 10:16:12 +020099 },
100 {
101 "type": "file",
azvyagintseve1b236a2018-07-13 16:59:49 +0300102 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
jan kaufman0fcf1a72015-05-06 10:16:12 +0200103 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
Filip Pytloun60411d12015-06-25 21:14:41 +0200104 },
105 {
106 "type": "file",
azvyagintseve1b236a2018-07-13 16:59:49 +0300107 "source": "files/etc/cloud/cloud.cfg",
Filip Pytloun60411d12015-06-25 21:14:41 +0200108 "destination": "/etc/cloud/cloud.cfg"
jan kaufmana519d7b2015-03-04 00:51:47 +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 Pytloun7b48fd22015-06-30 23:34:01 +0200120 },
121 {
Filip Pytloun6e4c3b72015-07-23 09:20:13 +0200122 "type": "docker-tag",
Filip Pytlounc2b0ca02016-06-09 16:26:30 +0200123 "repository": "tcpcloud/ubuntu",
Filip Pytloun6e4c3b72015-07-23 09:20:13 +0200124 "tag": "14.04",
azvyagintsevd8f85232017-10-02 15:30:28 +0300125 "only": [
126 "docker"
127 ]
Filip Pytloun6e4c3b72015-07-23 09:20:13 +0200128 },
129 {
Filip Pytloun62c8f832015-07-22 17:40:00 +0200130 "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 ]
jan kaufmana519d7b2015-03-04 00:51:47 +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>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200156 " passwd/root-password={{user `password`}} ",
157 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100158 " locale=en_US<wait>",
159 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufmandfc08f02015-04-29 20:17:55 +0200160 " netcfg/get_domain=cloudlab.cz<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100161 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200162 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100163 " -- <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`}}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100169 "guest_os_type": "Ubuntu_64",
170 "http_directory": "http",
azvyagintseve1b236a2018-07-13 16:59:49 +0300171 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
jan kaufmana519d7b2015-03-04 00:51:47 +0100172 "iso_checksum_type": "md5",
azvyagintseve1b236a2018-07-13 16:59:49 +0300173 "iso_url": "http://releases.ubuntu.com/14.04/ubuntu-14.04.3-server-amd64.iso",
jan kaufmana519d7b2015-03-04 00:51:47 +0100174 "ssh_username": "{{user `user`}}",
175 "ssh_password": "{{user `password`}}",
176 "ssh_port": 22,
177 "ssh_wait_timeout": "10000s",
azvyagintsevdd137842018-07-13 18:13:06 +0300178 "shutdown_command": "shutdown -P now",
Filip Pytloun019c5d42015-07-22 18:59:15 +0200179 "headless": true,
jan kaufmana519d7b2015-03-04 00:51:47 +0100180 "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 ]
jan kaufmana519d7b2015-03-04 00:51:47 +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>",
Filip Pytloun896f37b2015-06-25 18:35:42 +0200231 " passwd/root-password={{user `password`}} ",
232 " passwd/root-password-again={{user `password`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100233 " locale=en_US<wait>",
234 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100235 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100236 " noapic<wait>",
Filip Pytloun5bfc1df2015-07-13 14:36:46 +0200237 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100238 " -- <wait>",
239 "<enter><wait>"
240 ],
241 "boot_wait": "5s",
242 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200243 "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`}}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100246 "guest_os_type": "linux",
247 "http_directory": "http",
azvyagintseve1b236a2018-07-13 16:59:49 +0300248 "iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
jan kaufmana519d7b2015-03-04 00:51:47 +0100249 "iso_checksum_type": "md5",
azvyagintseve1b236a2018-07-13 16:59:49 +0300250 "iso_url": "http://releases.ubuntu.com/14.04/ubuntu-14.04.3-server-amd64.iso",
jan kaufmana519d7b2015-03-04 00:51:47 +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",
jan kaufmana519d7b2015-03-04 00:51:47 +0100256 "vmx_data": {
jan kaufmandfc08f02015-04-29 20:17:55 +0200257 "memsize": "1024",
jan kaufmana519d7b2015-03-04 00:51:47 +0100258 "numvcpus": "1",
259 "cpuid.coresPerSocket": "1"
260 }
261 },
262 {
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200263 "type": "docker",
264 "image": "ubuntu:14.04",
265 "commit": true
Filip Pytloun896f37b2015-06-25 18:35:42 +0200266 },
Filip Pytloun7b48fd22015-06-30 23:34:01 +0200267 {
jan kaufmana519d7b2015-03-04 00:51:47 +0100268 "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\" }}",
azvyagintsevd8f85232017-10-02 15:30:28 +0300272 "region": "ams2",
273 "size": "1gb"
azvyagintseve1b236a2018-07-13 16:59:49 +0300274 },
275 {
276 "type": "qemu",
277 "qemuargs": [
278 [ "-m", "1024M" ],
279 [ "-cdrom", "config-drive/cloudata.iso" ]
280 ],
281 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
282 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
283 "format": "qcow2",
284 "iso_checksum": "06d561ab1ae8723493b484c1effc2790",
285 "iso_checksum_type": "md5",
286 "iso_url": "http://cloud-images.ubuntu.com/releases/trusty/release-20180703/ubuntu-14.04-server-cloudimg-amd64-disk1.img",
287 "iso_target_path": "{{ user `images_cache`}}/release-20180703_ubuntu-14.04-server-cloudimg-amd64-disk1.img",
288 "disk_image": true,
289 "disk_compression": true,
290 "accelerator": "kvm",
291 "disk_size": "{{ user `disk_size`}}",
292 "headless": true,
293 "ssh_username": "{{ user `user` }}",
294 "ssh_password": "{{ user `password` }}",
295 "ssh_host_port_min": 7000,
296 "ssh_host_port_max": 7050,
azvyagintsevdd137842018-07-13 18:13:06 +0300297 "shutdown_command": "shutdown -P now",
azvyagintseve1b236a2018-07-13 16:59:49 +0300298 "boot_wait": "2s",
299 "ssh_wait_timeout": "360s"
300 },
301 {
302 "type": "openstack",
303 "ssh_username": "{{ user `user` }}",
304 "ssh_password": "{{ user `password` }}",
305 "image_name": "{{user `image_name`}}",
306 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
307 "reuse_ips": "true",
308 "source_image": "{{ user `os_image` }}",
309 "flavor": "{{ user `os_flavor` }}",
310 "user_data_file": "config-drive/user-data.yaml",
311 "tenant_id": "{{ user `os_tenant` }}",
312 "networks": ["{{ user `os_network` }}"],
313 "availability_zone": "{{user `os_zone`}}",
314 "identity_endpoint": "{{user `os_endpoint`}}",
315 "username": "{{user `os_username`}}",
316 "password": "{{user `os_password`}}"
jan kaufmana519d7b2015-03-04 00:51:47 +0100317 }
318 ]
azvyagintseve1b236a2018-07-13 16:59:49 +0300319}