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", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 13 | "formula_version": "{{ env `FORMULA_VERSION` }}", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 14 | "mcp_version": "{{ env `MCP_VERSION` }}", |
| 15 | "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}", |
| 16 | "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}", |
| 17 | "saltstack_repo": "{{ env `SALTSTACK_REPO` }}", |
| 18 | "apt_mirantis_gpg": "{{ env `APT_MIRANTIS_GPG` }}", |
| 19 | "apt_mirantis_salt_repo": "{{ env `APT_MIRANTIS_SALT_REPO` }}", |
| 20 | "git_salt_formulas_scripts": "{{ env `GIT_SALT_FORMULAS_SCRIPTS` }}", |
| 21 | "apt_repository": "{{ env `APT_REPOSITORY` }}", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 22 | "apt_repository_gpg": "{{ env `APT_REPOSITORY_GPG` }}", |
Richard Felkl | 6d5bd49 | 2018-04-26 09:49:29 +0200 | [diff] [blame] | 23 | "os_flavor": "27574e15-f031-4b78-a82d-4cef3aea9442", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 24 | "os_username": "{{ env `OS_USERNAME` }}", |
| 25 | "os_password": "{{ env `OS_PASSWORD` }}", |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 26 | "os_image": "7451fac0-0ce5-4d30-ae36-cd9a90e7948e", |
| 27 | "os_endpoint": "https://cloud-cz.bud.mirantis.net:5000/v2.0", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 28 | "os_zone": "mcp-mk", |
| 29 | "os_floating_ip_pool": "public", |
| 30 | "os_tenant": "26e4dd19485249608ee3685f254f3909", |
| 31 | "os_network": "772f8ca6-1f4a-4535-99d0-880d6ead9a82" |
| 32 | |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 33 | }, |
| 34 | "provisioners": [ |
| 35 | { |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 36 | "type": "file", |
| 37 | "source": "files/root/interfaces", |
| 38 | "destination": "/root/interfaces" |
| 39 | }, |
| 40 | { |
| 41 | "type": "file", |
| 42 | "source": "files/root/minion.conf", |
| 43 | "destination": "/root/minion.conf" |
| 44 | }, |
| 45 | { |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 46 | "type": "file", |
| 47 | "source": "files/tmp/bootstrap.saltstack.com.sh", |
| 48 | "destination": "/tmp/bootstrap.saltstack.com.sh" |
| 49 | }, |
| 50 | { |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 51 | "environment_vars": [ |
| 52 | "CLUSTER_MODEL={{ user `cluster_model` }}", |
| 53 | "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}", |
| 54 | "CLUSTER_NAME={{ user `cluster_name` }}", |
azvyagintsev | ffa75b4 | 2018-06-06 20:38:54 +0300 | [diff] [blame] | 55 | "BS_HOSTNAME={{ user `bs_hostname` }}", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 56 | "FORMULA_VERSION={{ user `formula_version` }}", |
| 57 | "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}", |
| 58 | "SALTSTACK_GPG={{ user `saltstack_gpg` }}", |
| 59 | "SALTSTACK_REPO={{ user `saltstack_repo` }}", |
| 60 | "APT_MIRANTIS_GPG={{ user `apt_mirantis_gpg` }}", |
| 61 | "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}", |
| 62 | "GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}", |
| 63 | "APT_REPOSITORY={{ user `apt_repository` }}", |
| 64 | "APT_REPOSITORY_GPG={{ user `apt_repository_gpg` }}", |
| 65 | "PACKER_OFFLINE_BUILD=true" |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 66 | ], |
| 67 | "type": "shell", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 68 | "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 69 | "expect_disconnect": "true", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 70 | "scripts": [ |
| 71 | "scripts/base.sh", |
azvyagintsev | c0d1b8a | 2018-03-22 19:05:03 +0200 | [diff] [blame] | 72 | "scripts/motd.sh", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 73 | "scripts/network.sh", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 74 | "scripts/salt_bootstrap.sh", |
| 75 | "scripts/reboot.sh" |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 76 | ] |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 77 | }, |
| 78 | { |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 79 | "environment_vars": [ |
| 80 | "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}" |
| 81 | ], |
azvyagintsev | 29410ee | 2018-07-12 20:02:30 +0300 | [diff] [blame] | 82 | "pause_before": "60s", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 83 | "type": "shell", |
| 84 | "expect_disconnect": "true", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 85 | "scripts": [ |
| 86 | "scripts/salt.sh" |
| 87 | ] |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 88 | }, |
| 89 | { |
| 90 | "environment_vars": [ |
| 91 | "HOME=/root", |
| 92 | "MCP_VERSION={{ user `mcp_version` }}" |
| 93 | ], |
| 94 | "type": "shell", |
azvyagintsev | 29410ee | 2018-07-12 20:02:30 +0300 | [diff] [blame] | 95 | "pause_before": "60s", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 96 | "scripts": [ |
| 97 | "scripts/mirrors.sh", |
| 98 | "scripts/security.sh", |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 99 | "scripts/info.sh", |
azvyagintsev | 1726e80 | 2018-06-15 16:55:44 +0300 | [diff] [blame] | 100 | "scripts/cleanup.sh", |
azvyagintsev | 29410ee | 2018-07-12 20:02:30 +0300 | [diff] [blame] | 101 | "scripts/cleanup_salt.sh", |
azvyagintsev | 1726e80 | 2018-06-15 16:55:44 +0300 | [diff] [blame] | 102 | "scripts/zerodisk.sh" |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 103 | ] |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 104 | }, |
| 105 | { |
| 106 | "type": "file", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 107 | "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 108 | "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg" |
| 109 | }, |
| 110 | { |
| 111 | "type": "file", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 112 | "source": "files/etc/cloud/cloud.cfg", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 113 | "destination": "/etc/cloud/cloud.cfg" |
| 114 | } |
| 115 | ], |
| 116 | "builders": [ |
| 117 | { |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 118 | "type": "openstack", |
| 119 | "ssh_username": "{{user `user`}}", |
| 120 | "ssh_password": "{{user `password`}}", |
| 121 | "image_name": "{{user `image_name`}}", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 122 | "floating_ip_pool": "{{user `os_floating_ip_pool`}}", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 123 | "reuse_ips": "true", |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 124 | "source_image": "{{ user `os_image` }}", |
| 125 | "flavor": "{{ user `os_flavor` }}", |
| 126 | "user_data_file": "config-drive/user-data.yaml", |
| 127 | "tenant_id": "{{ user `os_tenant` }}", |
| 128 | "networks": ["{{ user `os_network` }}"], |
| 129 | "availability_zone": "{{user `os_zone`}}", |
| 130 | "identity_endpoint": "{{user `os_endpoint`}}", |
| 131 | "username": "{{user `os_username`}}", |
| 132 | "password": "{{user `os_password`}}" |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 133 | }, |
| 134 | { |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 135 | "type": "qemu", |
| 136 | "qemuargs": [ |
| 137 | [ |
| 138 | "-m", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 139 | "8096M" |
| 140 | ], |
| 141 | [ |
| 142 | "-fda", |
| 143 | "config-drive/cloudata.iso" |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 144 | ], |
| 145 | [ |
| 146 | "-smp", |
| 147 | "4" |
| 148 | ] |
| 149 | ], |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 150 | "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}", |
| 151 | "output_directory": "images/{{ user `image_name`}}", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 152 | "format": "qcow2", |
| 153 | "accelerator": "kvm", |
| 154 | "disk_size": "{{ user `disk_size`}}", |
alexz | 8c4cfc7 | 2018-03-23 13:56:10 +0100 | [diff] [blame] | 155 | "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] | 156 | "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] | 157 | "iso_checksum_type": "md5", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 158 | "disk_image": true, |
azvyagintsev | 0adfe68 | 2018-06-13 16:29:40 +0300 | [diff] [blame] | 159 | "disk_compression": true, |
alexz | 8c4cfc7 | 2018-03-23 13:56:10 +0100 | [diff] [blame] | 160 | "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 161 | "http_directory": "http", |
| 162 | "headless": true, |
| 163 | "ssh_username": "{{user `user`}}", |
| 164 | "ssh_password": "{{user `password`}}", |
azvyagintsev | dd13784 | 2018-07-13 18:13:06 +0300 | [diff] [blame] | 165 | "shutdown_command": "shutdown -P now", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 166 | "vnc_bind_address": "0.0.0.0", |
| 167 | "vnc_port_max": "5956", |
| 168 | "vnc_port_min": "5956", |
azvyagintsev | 0adfe68 | 2018-06-13 16:29:40 +0300 | [diff] [blame] | 169 | "ssh_host_port_min": 7000, |
| 170 | "ssh_host_port_max": 7050, |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 171 | "boot_wait": "2s", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 172 | "ssh_wait_timeout": "360s" |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 173 | } |
| 174 | ] |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 175 | } |