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", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 5 | "do_api_token": "{{ env `DO_API_TOKEN` }}", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 6 | "image_name": "{{ env `IMAGE_NAME` }}", |
| 7 | "VM_IMAGE": "{{ env `VM_IMAGE` }}", |
| 8 | "floating_ip_pool": "{{ env `VM_FLOATING_IP_POOL` }}", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 9 | "VM_FLAVOR": "{{ env `VM_FLAVOR` }}", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 10 | "disk_size": "150000", |
| 11 | "cluster_model": "{{ env `CLUSTER_MODEL` }}", |
| 12 | "cluster_model_ref": "{{ env `CLUSTER_MODEL_REF` }}", |
| 13 | "cluster_name": "{{ env `CLUSTER_NAME` }}", |
| 14 | "formula_version": "{{ env `FORMULA_VERSION` }}", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 15 | "mcp_version": "{{ env `MCP_VERSION` }}", |
| 16 | "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}", |
| 17 | "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}", |
| 18 | "saltstack_repo": "{{ env `SALTSTACK_REPO` }}", |
| 19 | "apt_mirantis_gpg": "{{ env `APT_MIRANTIS_GPG` }}", |
| 20 | "apt_mirantis_salt_repo": "{{ env `APT_MIRANTIS_SALT_REPO` }}", |
| 21 | "git_salt_formulas_scripts": "{{ env `GIT_SALT_FORMULAS_SCRIPTS` }}", |
| 22 | "apt_repository": "{{ env `APT_REPOSITORY` }}", |
| 23 | "apt_repository_gpg": "{{ env `APT_REPOSITORY_GPG` }}" |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 24 | }, |
| 25 | "provisioners": [ |
| 26 | { |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 27 | "type": "file", |
| 28 | "source": "files/root/interfaces", |
| 29 | "destination": "/root/interfaces" |
| 30 | }, |
| 31 | { |
| 32 | "type": "file", |
| 33 | "source": "files/root/minion.conf", |
| 34 | "destination": "/root/minion.conf" |
| 35 | }, |
| 36 | { |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 37 | "type": "file", |
| 38 | "source": "files/tmp/bootstrap.saltstack.com.sh", |
| 39 | "destination": "/tmp/bootstrap.saltstack.com.sh" |
| 40 | }, |
| 41 | { |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 42 | "environment_vars": [ |
| 43 | "CLUSTER_MODEL={{ user `cluster_model` }}", |
| 44 | "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}", |
| 45 | "CLUSTER_NAME={{ user `cluster_name` }}", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 46 | "FORMULA_VERSION={{ user `formula_version` }}", |
| 47 | "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}", |
| 48 | "SALTSTACK_GPG={{ user `saltstack_gpg` }}", |
| 49 | "SALTSTACK_REPO={{ user `saltstack_repo` }}", |
| 50 | "APT_MIRANTIS_GPG={{ user `apt_mirantis_gpg` }}", |
| 51 | "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}", |
| 52 | "GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}", |
| 53 | "APT_REPOSITORY={{ user `apt_repository` }}", |
| 54 | "APT_REPOSITORY_GPG={{ user `apt_repository_gpg` }}", |
| 55 | "PACKER_OFFLINE_BUILD=true" |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 56 | ], |
| 57 | "type": "shell", |
| 58 | "expect_disconnect": "true", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 59 | "scripts": [ |
| 60 | "scripts/base.sh", |
| 61 | "scripts/network.sh", |
| 62 | "scripts/salt_bootstrap.sh" |
| 63 | ] |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 64 | }, |
| 65 | { |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 66 | "environment_vars": [ |
| 67 | "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}" |
| 68 | ], |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 69 | "type": "shell", |
| 70 | "expect_disconnect": "true", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 71 | "scripts": [ |
| 72 | "scripts/salt.sh" |
| 73 | ] |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 74 | }, |
| 75 | { |
| 76 | "environment_vars": [ |
| 77 | "HOME=/root", |
| 78 | "MCP_VERSION={{ user `mcp_version` }}" |
| 79 | ], |
| 80 | "type": "shell", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 81 | "pause_before": "120s", |
| 82 | "scripts": [ |
| 83 | "scripts/mirrors.sh", |
| 84 | "scripts/security.sh", |
| 85 | "scripts/cleanup.sh" |
| 86 | ] |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 87 | }, |
| 88 | { |
| 89 | "type": "file", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 90 | "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 91 | "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg" |
| 92 | }, |
| 93 | { |
| 94 | "type": "file", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 95 | "source": "files/etc/cloud/cloud.cfg", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 96 | "destination": "/etc/cloud/cloud.cfg" |
| 97 | } |
| 98 | ], |
| 99 | "builders": [ |
| 100 | { |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 101 | "type": "openstack", |
| 102 | "ssh_username": "{{user `user`}}", |
| 103 | "ssh_password": "{{user `password`}}", |
| 104 | "image_name": "{{user `image_name`}}", |
| 105 | "floating_ip_pool": "{{user `floating_ip_pool`}}", |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 106 | "reuse_ips": "true", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 107 | "security_groups": [ |
| 108 | "open_all" |
| 109 | ], |
| 110 | "source_image": "{{ user `VM_IMAGE` }}", |
| 111 | "flavor": "{{ user `VM_FLAVOR` }}", |
| 112 | "user_data_file": "config-drive/user-data.yaml" |
| 113 | }, |
| 114 | { |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 115 | "type": "qemu", |
| 116 | "qemuargs": [ |
| 117 | [ |
| 118 | "-m", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 119 | "8096M" |
| 120 | ], |
| 121 | [ |
| 122 | "-fda", |
| 123 | "config-drive/cloudata.iso" |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 124 | ], |
| 125 | [ |
| 126 | "-smp", |
| 127 | "4" |
| 128 | ] |
| 129 | ], |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 130 | "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}", |
| 131 | "output_directory": "images/{{ user `image_name`}}", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 132 | "format": "qcow2", |
| 133 | "accelerator": "kvm", |
| 134 | "disk_size": "{{ user `disk_size`}}", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 135 | "iso_url": "http://cloud-images.ubuntu.com/xenial/20180224/xenial-server-cloudimg-amd64-disk1.img", |
| 136 | "iso_target_path": "/root/isos/xenial-server-cloudimg-amd64-disk1.img", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 137 | "iso_checksum_type": "md5", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 138 | "disk_image": true, |
| 139 | "iso_checksum": "697d8f9058ad118cea699d14ae414f8b", |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 140 | "http_directory": "http", |
| 141 | "headless": true, |
| 142 | "ssh_username": "{{user `user`}}", |
| 143 | "ssh_password": "{{user `password`}}", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 144 | "shutdown_command": "sync; shutdown -P now", |
| 145 | "vnc_bind_address": "0.0.0.0", |
| 146 | "vnc_port_max": "5956", |
| 147 | "vnc_port_min": "5956", |
| 148 | "ssh_host_port_min": 2223, |
| 149 | "ssh_host_port_max": 2223, |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 150 | "boot_wait": "2s", |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 151 | "ssh_wait_timeout": "360s" |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 152 | } |
| 153 | ] |
azvyagintsev | 6d45385 | 2018-02-26 16:56:37 +0200 | [diff] [blame] | 154 | } |