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