Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 1 | { |
| 2 | "variables": { |
| 3 | "user": "root", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 4 | "password": "r00tme", |
azvyagintsev | 0955f72 | 2018-07-13 21:01:19 +0300 | [diff] [blame] | 5 | "disk_size": "60000", |
azvyagintsev | 0f697cf | 2018-06-22 11:44:13 +0300 | [diff] [blame] | 6 | "images_cache": "{{ env `PACKER_IMAGES_CACHE` }}", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 7 | "do_api_token": "{{ env `DO_API_TOKEN` }}", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 8 | "image_name": "{{ env `IMAGE_NAME` }}", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 9 | "cluster_model": "{{ env `CLUSTER_MODEL` }}", |
| 10 | "cluster_model_ref": "{{ env `CLUSTER_MODEL_REF` }}", |
| 11 | "cluster_name": "{{ env `CLUSTER_NAME` }}", |
azvyagintsev | ffa75b4 | 2018-06-06 20:38:54 +0300 | [diff] [blame] | 12 | "bs_hostname": "apt01", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 13 | "mcp_version": "{{ env `MCP_VERSION` }}", |
| 14 | "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}", |
| 15 | "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}", |
| 16 | "saltstack_repo": "{{ env `SALTSTACK_REPO` }}", |
Ivan Berezovskiy | 7630eaf | 2018-12-17 16:33:14 +0400 | [diff] [blame] | 17 | "apt_mirantis_gpg": "{{ env `APT_MIRANTIS_SALT_GPG` }}", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 18 | "apt_mirantis_salt_repo": "{{ env `APT_MIRANTIS_SALT_REPO` }}", |
| 19 | "git_salt_formulas_scripts": "{{ env `GIT_SALT_FORMULAS_SCRIPTS` }}", |
Richard Felkl | 6d5bd49 | 2018-04-26 09:49:29 +0200 | [diff] [blame] | 20 | "os_flavor": "27574e15-f031-4b78-a82d-4cef3aea9442", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 21 | "os_username": "{{ env `OS_USERNAME` }}", |
| 22 | "os_password": "{{ env `OS_PASSWORD` }}", |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 23 | "os_image": "7451fac0-0ce5-4d30-ae36-cd9a90e7948e", |
| 24 | "os_endpoint": "https://cloud-cz.bud.mirantis.net:5000/v2.0", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 25 | "os_zone": "mcp-mk", |
| 26 | "os_floating_ip_pool": "public", |
| 27 | "os_tenant": "26e4dd19485249608ee3685f254f3909", |
| 28 | "os_network": "772f8ca6-1f4a-4535-99d0-880d6ead9a82" |
| 29 | |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 30 | }, |
| 31 | "provisioners": [ |
| 32 | { |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 33 | "type": "file", |
| 34 | "source": "files/root/interfaces", |
| 35 | "destination": "/root/interfaces" |
| 36 | }, |
| 37 | { |
| 38 | "type": "file", |
| 39 | "source": "files/root/minion.conf", |
| 40 | "destination": "/root/minion.conf" |
| 41 | }, |
| 42 | { |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 43 | "type": "file", |
| 44 | "source": "files/tmp/bootstrap.saltstack.com.sh", |
| 45 | "destination": "/tmp/bootstrap.saltstack.com.sh" |
| 46 | }, |
| 47 | { |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 48 | "environment_vars": [ |
| 49 | "CLUSTER_MODEL={{ user `cluster_model` }}", |
| 50 | "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}", |
| 51 | "CLUSTER_NAME={{ user `cluster_name` }}", |
azvyagintsev | ffa75b4 | 2018-06-06 20:38:54 +0300 | [diff] [blame] | 52 | "BS_HOSTNAME={{ user `bs_hostname` }}", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 53 | "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}", |
| 54 | "SALTSTACK_GPG={{ user `saltstack_gpg` }}", |
| 55 | "SALTSTACK_REPO={{ user `saltstack_repo` }}", |
Ivan Berezovskiy | 7630eaf | 2018-12-17 16:33:14 +0400 | [diff] [blame] | 56 | "APT_MIRANTIS_SALT_GPG={{ user `apt_mirantis_gpg` }}", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 57 | "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}", |
| 58 | "GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}", |
azvyagintsev | 2a25cb7 | 2019-02-07 15:30:51 +0200 | [diff] [blame] | 59 | "PACKER_OFFLINE_BUILD=true", |
| 60 | "MCP_VERSION={{ user `mcp_version` }}" |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 61 | ], |
| 62 | "type": "shell", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 63 | "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 64 | "expect_disconnect": "true", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 65 | "scripts": [ |
| 66 | "scripts/base.sh", |
azvyagintsev | c0d1b8a | 2018-03-22 19:05:03 +0200 | [diff] [blame] | 67 | "scripts/motd.sh", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 68 | "scripts/network.sh", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 69 | "scripts/salt_bootstrap.sh", |
| 70 | "scripts/reboot.sh" |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 71 | ] |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 72 | }, |
| 73 | { |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 74 | "environment_vars": [ |
| 75 | "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}" |
| 76 | ], |
azvyagintsev | 29410ee | 2018-07-12 20:02:30 +0300 | [diff] [blame] | 77 | "pause_before": "60s", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 78 | "type": "shell", |
| 79 | "expect_disconnect": "true", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 80 | "scripts": [ |
| 81 | "scripts/salt.sh" |
| 82 | ] |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 83 | }, |
| 84 | { |
| 85 | "environment_vars": [ |
| 86 | "HOME=/root", |
| 87 | "MCP_VERSION={{ user `mcp_version` }}" |
| 88 | ], |
| 89 | "type": "shell", |
azvyagintsev | 29410ee | 2018-07-12 20:02:30 +0300 | [diff] [blame] | 90 | "pause_before": "60s", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 91 | "scripts": [ |
| 92 | "scripts/mirrors.sh", |
| 93 | "scripts/security.sh", |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 94 | "scripts/info.sh", |
azvyagintsev | 1726e80 | 2018-06-15 16:55:44 +0300 | [diff] [blame] | 95 | "scripts/cleanup.sh", |
Vladimir Khlyunev | af648d3 | 2021-05-17 13:19:44 +0400 | [diff] [blame] | 96 | "scripts/cleanup_salt.sh" |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 97 | ] |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 98 | }, |
| 99 | { |
| 100 | "type": "file", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 101 | "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 102 | "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg" |
| 103 | }, |
| 104 | { |
| 105 | "type": "file", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 106 | "source": "files/etc/cloud/cloud.cfg", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 107 | "destination": "/etc/cloud/cloud.cfg" |
Vladimir Khlyunev | af648d3 | 2021-05-17 13:19:44 +0400 | [diff] [blame] | 108 | }, |
| 109 | { |
| 110 | "type": "file", |
| 111 | "source": "files/usr/local/bin/dockerswarm_cert.sh", |
| 112 | "destination": "/tmp/dockerswarm_cert.sh" |
| 113 | }, |
| 114 | { |
| 115 | "type": "shell", |
| 116 | "inline": ["mkdir -p /usr/local/bin", |
| 117 | "mv /tmp/dockerswarm_cert.sh /usr/local/bin/dockerswarm_cert.sh", |
| 118 | "chmod +x /usr/local/bin/dockerswarm_cert.sh"] |
| 119 | }, |
| 120 | { |
| 121 | "type": "file", |
| 122 | "source": "files/etc/systemd/system/dockerswarm_cert.service", |
| 123 | "destination": "/etc/systemd/system/dockerswarm_cert.service" |
| 124 | }, |
| 125 | { |
| 126 | "type": "shell", |
| 127 | "inline": ["systemctl enable dockerswarm_cert.service"] |
| 128 | }, |
| 129 | { |
| 130 | "type": "shell", |
| 131 | "pause_before": "60s", |
| 132 | "scripts": ["scripts/flush_disk.sh"] |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 133 | } |
| 134 | ], |
| 135 | "builders": [ |
| 136 | { |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 137 | "type": "openstack", |
| 138 | "ssh_username": "{{user `user`}}", |
| 139 | "ssh_password": "{{user `password`}}", |
| 140 | "image_name": "{{user `image_name`}}", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 141 | "floating_ip_pool": "{{user `os_floating_ip_pool`}}", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 142 | "reuse_ips": "true", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 143 | "source_image": "{{ user `os_image` }}", |
| 144 | "flavor": "{{ user `os_flavor` }}", |
| 145 | "user_data_file": "config-drive/user-data.yaml", |
| 146 | "tenant_id": "{{ user `os_tenant` }}", |
| 147 | "networks": ["{{ user `os_network` }}"], |
| 148 | "availability_zone": "{{user `os_zone`}}", |
| 149 | "identity_endpoint": "{{user `os_endpoint`}}", |
| 150 | "username": "{{user `os_username`}}", |
| 151 | "password": "{{user `os_password`}}" |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 152 | }, |
| 153 | { |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 154 | "type": "qemu", |
| 155 | "qemuargs": [ |
| 156 | [ |
| 157 | "-m", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 158 | "8096M" |
| 159 | ], |
| 160 | [ |
Ivan Berezovskiy | 23035a2 | 2018-11-14 13:25:51 +0400 | [diff] [blame] | 161 | "-cdrom", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 162 | "config-drive/cloudata.iso" |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 163 | ], |
| 164 | [ |
| 165 | "-smp", |
azvyagintsev | 5c4e2d6 | 2018-12-29 19:12:32 +0200 | [diff] [blame] | 166 | "8" |
azvyagintsev | 262b28c | 2018-10-23 18:38:42 +0300 | [diff] [blame] | 167 | ], |
| 168 | ["-device", "virtio-net,netdev=user.0"], |
| 169 | ["-object","rng-random,id=objrng0,filename=/dev/urandom"], |
| 170 | ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10" ] |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 171 | ], |
Aleksey Zvyagintsev | 42e7695 | 2018-12-14 13:40:44 +0000 | [diff] [blame] | 172 | "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}.qcow2", |
azvyagintsev | f87bbb8 | 2018-09-03 16:45:33 +0300 | [diff] [blame] | 173 | "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}", |
Aleksey Zvyagintsev | 42e7695 | 2018-12-14 13:40:44 +0000 | [diff] [blame] | 174 | "disk_compression": true, |
| 175 | "disk_size": "{{ user `disk_size`}}", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 176 | "format": "qcow2", |
| 177 | "accelerator": "kvm", |
alexz | 8c4cfc7 | 2018-03-23 13:56:10 +0100 | [diff] [blame] | 178 | "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img", |
azvyagintsev | 0f697cf | 2018-06-22 11:44:13 +0300 | [diff] [blame] | 179 | "iso_target_path": "{{ user `images_cache`}}/release-20180306_xenial-server-cloudimg-amd64-disk1.img", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 180 | "iso_checksum_type": "md5", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 181 | "disk_image": true, |
alexz | 8c4cfc7 | 2018-03-23 13:56:10 +0100 | [diff] [blame] | 182 | "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 183 | "http_directory": "http", |
| 184 | "headless": true, |
| 185 | "ssh_username": "{{user `user`}}", |
| 186 | "ssh_password": "{{user `password`}}", |
azvyagintsev | dd13784 | 2018-07-13 18:13:06 +0300 | [diff] [blame] | 187 | "shutdown_command": "shutdown -P now", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 188 | "vnc_bind_address": "0.0.0.0", |
| 189 | "vnc_port_max": "5956", |
| 190 | "vnc_port_min": "5956", |
azvyagintsev | 0adfe68 | 2018-06-13 16:29:40 +0300 | [diff] [blame] | 191 | "ssh_host_port_min": 7000, |
| 192 | "ssh_host_port_max": 7050, |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 193 | "boot_wait": "2s", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 194 | "ssh_wait_timeout": "360s" |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 195 | } |
| 196 | ] |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 197 | } |