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", |
azvyagintsev | 29410ee | 2018-07-12 20:02:30 +0300 | [diff] [blame] | 96 | "scripts/cleanup_salt.sh", |
Vladimir Khlyunev | 0b28723 | 2020-04-29 14:18:28 +0400 | [diff] [blame^] | 97 | "scripts/flush_disk.sh" |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 98 | ] |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 99 | }, |
| 100 | { |
| 101 | "type": "file", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 102 | "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 103 | "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg" |
| 104 | }, |
| 105 | { |
| 106 | "type": "file", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 107 | "source": "files/etc/cloud/cloud.cfg", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 108 | "destination": "/etc/cloud/cloud.cfg" |
| 109 | } |
| 110 | ], |
| 111 | "builders": [ |
| 112 | { |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 113 | "type": "openstack", |
| 114 | "ssh_username": "{{user `user`}}", |
| 115 | "ssh_password": "{{user `password`}}", |
| 116 | "image_name": "{{user `image_name`}}", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 117 | "floating_ip_pool": "{{user `os_floating_ip_pool`}}", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 118 | "reuse_ips": "true", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 119 | "source_image": "{{ user `os_image` }}", |
| 120 | "flavor": "{{ user `os_flavor` }}", |
| 121 | "user_data_file": "config-drive/user-data.yaml", |
| 122 | "tenant_id": "{{ user `os_tenant` }}", |
| 123 | "networks": ["{{ user `os_network` }}"], |
| 124 | "availability_zone": "{{user `os_zone`}}", |
| 125 | "identity_endpoint": "{{user `os_endpoint`}}", |
| 126 | "username": "{{user `os_username`}}", |
| 127 | "password": "{{user `os_password`}}" |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 128 | }, |
| 129 | { |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 130 | "type": "qemu", |
| 131 | "qemuargs": [ |
| 132 | [ |
| 133 | "-m", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 134 | "8096M" |
| 135 | ], |
| 136 | [ |
Ivan Berezovskiy | 23035a2 | 2018-11-14 13:25:51 +0400 | [diff] [blame] | 137 | "-cdrom", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 138 | "config-drive/cloudata.iso" |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 139 | ], |
| 140 | [ |
| 141 | "-smp", |
azvyagintsev | 5c4e2d6 | 2018-12-29 19:12:32 +0200 | [diff] [blame] | 142 | "8" |
azvyagintsev | 262b28c | 2018-10-23 18:38:42 +0300 | [diff] [blame] | 143 | ], |
| 144 | ["-device", "virtio-net,netdev=user.0"], |
| 145 | ["-object","rng-random,id=objrng0,filename=/dev/urandom"], |
| 146 | ["-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] | 147 | ], |
Aleksey Zvyagintsev | 42e7695 | 2018-12-14 13:40:44 +0000 | [diff] [blame] | 148 | "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}.qcow2", |
azvyagintsev | f87bbb8 | 2018-09-03 16:45:33 +0300 | [diff] [blame] | 149 | "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}", |
Aleksey Zvyagintsev | 42e7695 | 2018-12-14 13:40:44 +0000 | [diff] [blame] | 150 | "disk_compression": true, |
| 151 | "disk_size": "{{ user `disk_size`}}", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 152 | "format": "qcow2", |
| 153 | "accelerator": "kvm", |
alexz | 8c4cfc7 | 2018-03-23 13:56:10 +0100 | [diff] [blame] | 154 | "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] | 155 | "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] | 156 | "iso_checksum_type": "md5", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 157 | "disk_image": true, |
alexz | 8c4cfc7 | 2018-03-23 13:56:10 +0100 | [diff] [blame] | 158 | "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 159 | "http_directory": "http", |
| 160 | "headless": true, |
| 161 | "ssh_username": "{{user `user`}}", |
| 162 | "ssh_password": "{{user `password`}}", |
azvyagintsev | dd13784 | 2018-07-13 18:13:06 +0300 | [diff] [blame] | 163 | "shutdown_command": "shutdown -P now", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 164 | "vnc_bind_address": "0.0.0.0", |
| 165 | "vnc_port_max": "5956", |
| 166 | "vnc_port_min": "5956", |
azvyagintsev | 0adfe68 | 2018-06-13 16:29:40 +0300 | [diff] [blame] | 167 | "ssh_host_port_min": 7000, |
| 168 | "ssh_host_port_max": 7050, |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 169 | "boot_wait": "2s", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 170 | "ssh_wait_timeout": "360s" |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 171 | } |
| 172 | ] |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 173 | } |