blob: bd5f6e89d6e42d4f4a618b723a7fc78a9186864a [file] [log] [blame]
Richard Felkld59c5652018-02-08 13:14:05 +01001{
2 "variables": {
3 "user": "root",
azvyagintsev6d453852018-02-26 16:56:37 +02004 "password": "r00tme",
azvyagintsev4053eb22018-03-29 16:21:51 +03005 "disk_size": "150000",
Richard Felkld59c5652018-02-08 13:14:05 +01006 "do_api_token": "{{ env `DO_API_TOKEN` }}",
azvyagintsev6d453852018-02-26 16:56:37 +02007 "image_name": "{{ env `IMAGE_NAME` }}",
Richard Felkld59c5652018-02-08 13:14:05 +01008 "cluster_model": "{{ env `CLUSTER_MODEL` }}",
9 "cluster_model_ref": "{{ env `CLUSTER_MODEL_REF` }}",
10 "cluster_name": "{{ env `CLUSTER_NAME` }}",
azvyagintsevffa75b42018-06-06 20:38:54 +030011 "bs_hostname": "apt01",
Richard Felkld59c5652018-02-08 13:14:05 +010012 "formula_version": "{{ env `FORMULA_VERSION` }}",
azvyagintsev6d453852018-02-26 16:56:37 +020013 "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 Felkl47757902018-03-02 22:44:43 +010021 "apt_repository_gpg": "{{ env `APT_REPOSITORY_GPG` }}",
Richard Felkl6d5bd492018-04-26 09:49:29 +020022 "os_flavor": "27574e15-f031-4b78-a82d-4cef3aea9442",
Richard Felkl47757902018-03-02 22:44:43 +010023 "os_username": "{{ env `OS_USERNAME` }}",
24 "os_password": "{{ env `OS_PASSWORD` }}",
azvyagintsev4053eb22018-03-29 16:21:51 +030025 "os_image": "7451fac0-0ce5-4d30-ae36-cd9a90e7948e",
26 "os_endpoint": "https://cloud-cz.bud.mirantis.net:5000/v2.0",
Richard Felkl47757902018-03-02 22:44:43 +010027 "os_zone": "mcp-mk",
28 "os_floating_ip_pool": "public",
29 "os_tenant": "26e4dd19485249608ee3685f254f3909",
30 "os_network": "772f8ca6-1f4a-4535-99d0-880d6ead9a82"
31
Richard Felkld59c5652018-02-08 13:14:05 +010032 },
33 "provisioners": [
34 {
azvyagintsev6d453852018-02-26 16:56:37 +020035 "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 {
azvyagintsevc86fbaf2018-03-02 18:57:03 +020045 "type": "file",
46 "source": "files/tmp/bootstrap.saltstack.com.sh",
47 "destination": "/tmp/bootstrap.saltstack.com.sh"
48 },
49 {
Richard Felkld59c5652018-02-08 13:14:05 +010050 "environment_vars": [
51 "CLUSTER_MODEL={{ user `cluster_model` }}",
52 "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}",
53 "CLUSTER_NAME={{ user `cluster_name` }}",
azvyagintsevffa75b42018-06-06 20:38:54 +030054 "BS_HOSTNAME={{ user `bs_hostname` }}",
azvyagintsev6d453852018-02-26 16:56:37 +020055 "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 Felkld59c5652018-02-08 13:14:05 +010065 ],
66 "type": "shell",
Richard Felkl47757902018-03-02 22:44:43 +010067 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
Richard Felkld59c5652018-02-08 13:14:05 +010068 "expect_disconnect": "true",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020069 "scripts": [
70 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020071 "scripts/motd.sh",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020072 "scripts/network.sh",
Richard Felkl47757902018-03-02 22:44:43 +010073 "scripts/salt_bootstrap.sh",
74 "scripts/reboot.sh"
azvyagintsevc86fbaf2018-03-02 18:57:03 +020075 ]
Richard Felkld59c5652018-02-08 13:14:05 +010076 },
77 {
azvyagintsev6d453852018-02-26 16:56:37 +020078 "environment_vars": [
79 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}"
80 ],
Richard Felkl47757902018-03-02 22:44:43 +010081 "pause_before": "120s",
Richard Felkld59c5652018-02-08 13:14:05 +010082 "type": "shell",
83 "expect_disconnect": "true",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020084 "scripts": [
85 "scripts/salt.sh"
86 ]
Richard Felkld59c5652018-02-08 13:14:05 +010087 },
88 {
89 "environment_vars": [
90 "HOME=/root",
91 "MCP_VERSION={{ user `mcp_version` }}"
92 ],
93 "type": "shell",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020094 "pause_before": "120s",
95 "scripts": [
96 "scripts/mirrors.sh",
97 "scripts/security.sh",
azvyagintsev4053eb22018-03-29 16:21:51 +030098 "scripts/info.sh",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020099 "scripts/cleanup.sh"
100 ]
Richard Felkld59c5652018-02-08 13:14:05 +0100101 },
102 {
103 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +0200104 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +0100105 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
106 },
107 {
108 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +0200109 "source": "files/etc/cloud/cloud.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +0100110 "destination": "/etc/cloud/cloud.cfg"
111 }
112 ],
113 "builders": [
114 {
azvyagintsev6d453852018-02-26 16:56:37 +0200115 "type": "openstack",
116 "ssh_username": "{{user `user`}}",
117 "ssh_password": "{{user `password`}}",
118 "image_name": "{{user `image_name`}}",
Richard Felkl47757902018-03-02 22:44:43 +0100119 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
azvyagintsevc86fbaf2018-03-02 18:57:03 +0200120 "reuse_ips": "true",
Richard Felkl47757902018-03-02 22:44:43 +0100121 "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`}}"
azvyagintsev6d453852018-02-26 16:56:37 +0200130 },
131 {
Richard Felkld59c5652018-02-08 13:14:05 +0100132 "type": "qemu",
133 "qemuargs": [
134 [
135 "-m",
azvyagintsev6d453852018-02-26 16:56:37 +0200136 "8096M"
137 ],
138 [
139 "-fda",
140 "config-drive/cloudata.iso"
Richard Felkld59c5652018-02-08 13:14:05 +0100141 ],
142 [
143 "-smp",
144 "4"
145 ]
146 ],
azvyagintsev6d453852018-02-26 16:56:37 +0200147 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
148 "output_directory": "images/{{ user `image_name`}}",
Richard Felkld59c5652018-02-08 13:14:05 +0100149 "format": "qcow2",
150 "accelerator": "kvm",
151 "disk_size": "{{ user `disk_size`}}",
alexz8c4cfc72018-03-23 13:56:10 +0100152 "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img",
azvyagintsev6d453852018-02-26 16:56:37 +0200153 "iso_target_path": "/root/isos/xenial-server-cloudimg-amd64-disk1.img",
Richard Felkld59c5652018-02-08 13:14:05 +0100154 "iso_checksum_type": "md5",
azvyagintsev6d453852018-02-26 16:56:37 +0200155 "disk_image": true,
alexz8c4cfc72018-03-23 13:56:10 +0100156 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
Richard Felkld59c5652018-02-08 13:14:05 +0100157 "http_directory": "http",
158 "headless": true,
159 "ssh_username": "{{user `user`}}",
160 "ssh_password": "{{user `password`}}",
azvyagintsev6d453852018-02-26 16:56:37 +0200161 "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 Felkld59c5652018-02-08 13:14:05 +0100167 "boot_wait": "2s",
azvyagintsev6d453852018-02-26 16:56:37 +0200168 "ssh_wait_timeout": "360s"
Richard Felkld59c5652018-02-08 13:14:05 +0100169 }
170 ]
azvyagintsev6d453852018-02-26 16:56:37 +0200171}