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