Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 1 | { |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 2 | "variables": { |
| 3 | "user": "root", |
azvyagintsev | be15863 | 2018-12-13 20:23:52 +0200 | [diff] [blame] | 4 | "password": "r00tme", |
Vasyl Saienko | ba5bc5a | 2018-11-22 15:02:49 +0200 | [diff] [blame] | 5 | "disk_size": "5000", |
azvyagintsev | 0f697cf | 2018-06-22 11:44:13 +0300 | [diff] [blame] | 6 | "images_cache": "{{ env `PACKER_IMAGES_CACHE` }}", |
azvyagintsev | 8d93888 | 2018-08-29 12:36:36 +0300 | [diff] [blame] | 7 | "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}", |
Jiri Broulik | 2ad150e | 2018-04-19 17:48:55 +0200 | [diff] [blame] | 8 | "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}", |
| 9 | "saltstack_repo": "{{ env `SALTSTACK_REPO` }}", |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 10 | "do_api_token": "{{ env `DO_API_TOKEN` }}", |
Jiri Broulik | 0b21167 | 2018-04-11 09:35:47 +0200 | [diff] [blame] | 11 | "image_name": "{{ env `IMAGE_NAME` }}", |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 12 | "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" |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 20 | }, |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 21 | "provisioners": [ |
| 22 | { |
azvyagintsev | 9a1737f | 2019-03-11 15:44:54 +0200 | [diff] [blame] | 23 | "type": "shell-local", |
| 24 | "command": "cp -av ../common/files/scripts/growlvm.py files/scripts/growlvm.py" |
| 25 | }, |
| 26 | { |
azvyagintsev | 5a38855 | 2018-04-03 21:25:23 +0300 | [diff] [blame] | 27 | "type": "shell", |
| 28 | "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", |
| 29 | "expect_disconnect": "true", |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 30 | "environment_vars": [ |
| 31 | "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}", |
azvyagintsev | 5a38855 | 2018-04-03 21:25:23 +0300 | [diff] [blame] | 32 | "SALTSTACK_GPG={{ user `saltstack_gpg` }}", |
| 33 | "SALTSTACK_REPO={{ user `saltstack_repo` }}" |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 34 | ], |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 35 | "override": { |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 36 | "qemu": { |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 37 | "scripts": [ |
| 38 | "scripts/base.sh", |
azvyagintsev | c0d1b8a | 2018-03-22 19:05:03 +0200 | [diff] [blame] | 39 | "scripts/motd.sh", |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 40 | "scripts/salt.sh", |
Jakub Josef | 6bcf386 | 2017-05-03 16:16:39 +0200 | [diff] [blame] | 41 | "scripts/network.sh", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 42 | "scripts/security.sh", |
| 43 | "scripts/cleanup.sh", |
azvyagintsev | 1726e80 | 2018-06-15 16:55:44 +0300 | [diff] [blame] | 44 | "scripts/info.sh", |
| 45 | "scripts/zerodisk.sh" |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 46 | ] |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 47 | }, |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 48 | "openstack": { |
| 49 | "scripts": [ |
| 50 | "scripts/base.sh", |
| 51 | "scripts/motd.sh", |
| 52 | "scripts/salt.sh", |
| 53 | "scripts/network.sh", |
| 54 | "scripts/security.sh", |
| 55 | "scripts/cleanup.sh", |
azvyagintsev | 1726e80 | 2018-06-15 16:55:44 +0300 | [diff] [blame] | 56 | "scripts/info.sh", |
| 57 | "scripts/zerodisk.sh" |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 58 | ] |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 59 | } |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 60 | } |
| 61 | }, |
| 62 | { |
| 63 | "type": "file", |
Ivan Berezovskiy | 9f5c718 | 2018-09-06 13:36:25 +0400 | [diff] [blame] | 64 | "source": "files/etc/", |
| 65 | "destination": "/etc" |
Vasyl Saienko | 59096f2 | 2018-11-26 17:26:42 +0200 | [diff] [blame] | 66 | }, |
| 67 | { |
| 68 | "type": "file", |
| 69 | "source": "files/scripts/", |
| 70 | "destination": "/usr/bin" |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 71 | } |
| 72 | ], |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 73 | "builders": [ |
| 74 | { |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 75 | "type": "qemu", |
Filip Pytloun | 56cf9e3 | 2016-02-19 09:56:08 +0100 | [diff] [blame] | 76 | "qemuargs": [ |
Vasyl Saienko | ba5bc5a | 2018-11-22 15:02:49 +0200 | [diff] [blame] | 77 | ["-m", "1024M"], |
azvyagintsev | 262b28c | 2018-10-23 18:38:42 +0300 | [diff] [blame] | 78 | ["-device", "virtio-net,netdev=user.0"], |
| 79 | ["-object","rng-random,id=objrng0,filename=/dev/urandom"], |
Vasyl Saienko | ba5bc5a | 2018-11-22 15:02:49 +0200 | [diff] [blame] | 80 | ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10"] |
Filip Pytloun | 56cf9e3 | 2016-02-19 09:56:08 +0100 | [diff] [blame] | 81 | ], |
Aleksey Zvyagintsev | 42e7695 | 2018-12-14 13:40:44 +0000 | [diff] [blame] | 82 | "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}.qcow2", |
| 83 | "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}", |
| 84 | "disk_compression": true, |
| 85 | "disk_size": "{{ user `disk_size`}}", |
azvyagintsev | be15863 | 2018-12-13 20:23:52 +0200 | [diff] [blame] | 86 | "boot_key_interval": "50ms", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 87 | "accelerator": "kvm", |
Vasyl Saienko | ba5bc5a | 2018-11-22 15:02:49 +0200 | [diff] [blame] | 88 | "iso_checksum": "24636fd103a2a43c95659f1c3c63718e", |
| 89 | "iso_checksum_type": "md5", |
| 90 | "iso_url": "http://releases.ubuntu.com/16.04.5/ubuntu-16.04.5-server-amd64.iso", |
| 91 | "iso_target_path": "{{ user `images_cache` }}/ubuntu-16.04.5-server-amd64.iso", |
| 92 | "http_directory": "http", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 93 | "headless": true, |
Vasyl Saienko | ba5bc5a | 2018-11-22 15:02:49 +0200 | [diff] [blame] | 94 | "ssh_username": "{{user `user`}}", |
| 95 | "ssh_password": "{{user `password`}}", |
| 96 | "shutdown_command": "sync; sudo /sbin/shutdown -hP now", |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 97 | "boot_wait": "2s", |
azvyagintsev | be15863 | 2018-12-13 20:23:52 +0200 | [diff] [blame] | 98 | "ssh_wait_timeout": "15m", |
| 99 | "ssh_host_port_min": 7050, |
| 100 | "ssh_host_port_max": 7060, |
azvyagintsev | 393dc8e | 2018-11-19 11:31:26 +0200 | [diff] [blame] | 101 | "boot_command": [ |
Vasyl Saienko | ba5bc5a | 2018-11-22 15:02:49 +0200 | [diff] [blame] | 102 | "<enter><wait><f6><esc>", |
| 103 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 104 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 105 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 106 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 107 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 108 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 109 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 110 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
| 111 | "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", |
azvyagintsev | 393dc8e | 2018-11-19 11:31:26 +0200 | [diff] [blame] | 112 | "/install/vmlinuz<wait>", |
| 113 | " auto<wait>", |
| 114 | " console-setup/ask_detect=false<wait>", |
| 115 | " console-setup/layoutcode=us<wait>", |
| 116 | " console-setup/modelcode=pc105<wait>", |
| 117 | " debconf/frontend=noninteractive<wait>", |
| 118 | " debian-installer=en_US<wait>", |
| 119 | " fb=false<wait>", |
| 120 | " initrd=/install/initrd.gz<wait>", |
| 121 | " kbd-chooser/method=us<wait>", |
| 122 | " keyboard-configuration/layout=USA<wait>", |
| 123 | " keyboard-configuration/variant=USA<wait>", |
azvyagintsev | 393dc8e | 2018-11-19 11:31:26 +0200 | [diff] [blame] | 124 | " locale=en_US<wait>", |
| 125 | " netcfg/get_hostname=ubuntu<wait>", |
| 126 | " netcfg/get_domain=local<wait>", |
| 127 | " noapic<wait>", |
| 128 | " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>", |
| 129 | " -- <wait>", |
| 130 | "<enter><wait>" |
| 131 | ] |
azvyagintsev | d8f8523 | 2017-10-02 15:30:28 +0300 | [diff] [blame] | 132 | }, |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 133 | { |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 134 | "type": "openstack", |
| 135 | "ssh_username": "{{user `user`}}", |
| 136 | "ssh_password": "{{user `password`}}", |
| 137 | "image_name": "{{user `image_name`}}", |
| 138 | "floating_ip_pool": "{{user `os_floating_ip_pool`}}", |
| 139 | "reuse_ips": "true", |
| 140 | "source_image": "{{ user `os_image` }}", |
| 141 | "flavor": "{{ user `os_flavor` }}", |
| 142 | "user_data_file": "config-drive/user-data.yaml", |
| 143 | "tenant_id": "{{ user `os_tenant` }}", |
| 144 | "networks": ["{{ user `os_network` }}"], |
| 145 | "availability_zone": "{{user `os_zone`}}", |
| 146 | "identity_endpoint": "{{user `os_endpoint`}}", |
| 147 | "username": "{{user `os_username`}}", |
| 148 | "password": "{{user `os_password`}}" |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 149 | } |
| 150 | ] |
alexz | 5b79514 | 2018-02-13 15:59:28 +0100 | [diff] [blame] | 151 | } |