blob: 5b942d087a1ec58a945f49079a083ad19b85cca6 [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",
azvyagintsev0adfe682018-06-13 16:29:40 +03005 "disk_size": "100000",
azvyagintsev0f697cf2018-06-22 11:44:13 +03006 "images_cache": "{{ env `PACKER_IMAGES_CACHE` }}",
Richard Felkld59c5652018-02-08 13:14:05 +01007 "do_api_token": "{{ env `DO_API_TOKEN` }}",
azvyagintsev6d453852018-02-26 16:56:37 +02008 "image_name": "{{ env `IMAGE_NAME` }}",
Richard Felkld59c5652018-02-08 13:14:05 +01009 "cluster_model": "{{ env `CLUSTER_MODEL` }}",
10 "cluster_model_ref": "{{ env `CLUSTER_MODEL_REF` }}",
11 "cluster_name": "{{ env `CLUSTER_NAME` }}",
azvyagintsevffa75b42018-06-06 20:38:54 +030012 "bs_hostname": "apt01",
Richard Felkld59c5652018-02-08 13:14:05 +010013 "formula_version": "{{ env `FORMULA_VERSION` }}",
azvyagintsev6d453852018-02-26 16:56:37 +020014 "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 Felkl47757902018-03-02 22:44:43 +010022 "apt_repository_gpg": "{{ env `APT_REPOSITORY_GPG` }}",
Richard Felkl6d5bd492018-04-26 09:49:29 +020023 "os_flavor": "27574e15-f031-4b78-a82d-4cef3aea9442",
Richard Felkl47757902018-03-02 22:44:43 +010024 "os_username": "{{ env `OS_USERNAME` }}",
25 "os_password": "{{ env `OS_PASSWORD` }}",
azvyagintsev4053eb22018-03-29 16:21:51 +030026 "os_image": "7451fac0-0ce5-4d30-ae36-cd9a90e7948e",
27 "os_endpoint": "https://cloud-cz.bud.mirantis.net:5000/v2.0",
Richard Felkl47757902018-03-02 22:44:43 +010028 "os_zone": "mcp-mk",
29 "os_floating_ip_pool": "public",
30 "os_tenant": "26e4dd19485249608ee3685f254f3909",
31 "os_network": "772f8ca6-1f4a-4535-99d0-880d6ead9a82"
32
Richard Felkld59c5652018-02-08 13:14:05 +010033 },
34 "provisioners": [
35 {
azvyagintsev6d453852018-02-26 16:56:37 +020036 "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 {
azvyagintsevc86fbaf2018-03-02 18:57:03 +020046 "type": "file",
47 "source": "files/tmp/bootstrap.saltstack.com.sh",
48 "destination": "/tmp/bootstrap.saltstack.com.sh"
49 },
50 {
Richard Felkld59c5652018-02-08 13:14:05 +010051 "environment_vars": [
52 "CLUSTER_MODEL={{ user `cluster_model` }}",
53 "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}",
54 "CLUSTER_NAME={{ user `cluster_name` }}",
azvyagintsevffa75b42018-06-06 20:38:54 +030055 "BS_HOSTNAME={{ user `bs_hostname` }}",
azvyagintsev6d453852018-02-26 16:56:37 +020056 "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 Felkld59c5652018-02-08 13:14:05 +010066 ],
67 "type": "shell",
Richard Felkl47757902018-03-02 22:44:43 +010068 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
Richard Felkld59c5652018-02-08 13:14:05 +010069 "expect_disconnect": "true",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020070 "scripts": [
71 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020072 "scripts/motd.sh",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020073 "scripts/network.sh",
Richard Felkl47757902018-03-02 22:44:43 +010074 "scripts/salt_bootstrap.sh",
75 "scripts/reboot.sh"
azvyagintsevc86fbaf2018-03-02 18:57:03 +020076 ]
Richard Felkld59c5652018-02-08 13:14:05 +010077 },
78 {
azvyagintsev6d453852018-02-26 16:56:37 +020079 "environment_vars": [
80 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}"
81 ],
Richard Felkl47757902018-03-02 22:44:43 +010082 "pause_before": "120s",
Richard Felkld59c5652018-02-08 13:14:05 +010083 "type": "shell",
84 "expect_disconnect": "true",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020085 "scripts": [
86 "scripts/salt.sh"
87 ]
Richard Felkld59c5652018-02-08 13:14:05 +010088 },
89 {
90 "environment_vars": [
91 "HOME=/root",
92 "MCP_VERSION={{ user `mcp_version` }}"
93 ],
94 "type": "shell",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020095 "pause_before": "120s",
96 "scripts": [
97 "scripts/mirrors.sh",
98 "scripts/security.sh",
azvyagintsev4053eb22018-03-29 16:21:51 +030099 "scripts/info.sh",
azvyagintsev1726e802018-06-15 16:55:44 +0300100 "scripts/cleanup.sh",
101 "scripts/zerodisk.sh"
azvyagintsevc86fbaf2018-03-02 18:57:03 +0200102 ]
Richard Felkld59c5652018-02-08 13:14:05 +0100103 },
104 {
105 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +0200106 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +0100107 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
108 },
109 {
110 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +0200111 "source": "files/etc/cloud/cloud.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +0100112 "destination": "/etc/cloud/cloud.cfg"
113 }
114 ],
115 "builders": [
116 {
azvyagintsev6d453852018-02-26 16:56:37 +0200117 "type": "openstack",
118 "ssh_username": "{{user `user`}}",
119 "ssh_password": "{{user `password`}}",
120 "image_name": "{{user `image_name`}}",
Richard Felkl47757902018-03-02 22:44:43 +0100121 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
azvyagintsevc86fbaf2018-03-02 18:57:03 +0200122 "reuse_ips": "true",
Richard Felkl47757902018-03-02 22:44:43 +0100123 "source_image": "{{ user `os_image` }}",
124 "flavor": "{{ user `os_flavor` }}",
125 "user_data_file": "config-drive/user-data.yaml",
126 "tenant_id": "{{ user `os_tenant` }}",
127 "networks": ["{{ user `os_network` }}"],
128 "availability_zone": "{{user `os_zone`}}",
129 "identity_endpoint": "{{user `os_endpoint`}}",
130 "username": "{{user `os_username`}}",
131 "password": "{{user `os_password`}}"
azvyagintsev6d453852018-02-26 16:56:37 +0200132 },
133 {
Richard Felkld59c5652018-02-08 13:14:05 +0100134 "type": "qemu",
135 "qemuargs": [
136 [
137 "-m",
azvyagintsev6d453852018-02-26 16:56:37 +0200138 "8096M"
139 ],
140 [
141 "-fda",
142 "config-drive/cloudata.iso"
Richard Felkld59c5652018-02-08 13:14:05 +0100143 ],
144 [
145 "-smp",
146 "4"
147 ]
148 ],
azvyagintsev6d453852018-02-26 16:56:37 +0200149 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
150 "output_directory": "images/{{ user `image_name`}}",
Richard Felkld59c5652018-02-08 13:14:05 +0100151 "format": "qcow2",
152 "accelerator": "kvm",
153 "disk_size": "{{ user `disk_size`}}",
alexz8c4cfc72018-03-23 13:56:10 +0100154 "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img",
azvyagintsev0f697cf2018-06-22 11:44:13 +0300155 "iso_target_path": "{{ user `images_cache`}}/release-20180306_xenial-server-cloudimg-amd64-disk1.img",
Richard Felkld59c5652018-02-08 13:14:05 +0100156 "iso_checksum_type": "md5",
azvyagintsev6d453852018-02-26 16:56:37 +0200157 "disk_image": true,
azvyagintsev0adfe682018-06-13 16:29:40 +0300158 "disk_compression": true,
alexz8c4cfc72018-03-23 13:56:10 +0100159 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
Richard Felkld59c5652018-02-08 13:14:05 +0100160 "http_directory": "http",
161 "headless": true,
162 "ssh_username": "{{user `user`}}",
163 "ssh_password": "{{user `password`}}",
azvyagintsev41bc80d2018-07-12 13:46:56 +0300164 "shutdown_command": "sync ; shutdown -P now",
azvyagintsev6d453852018-02-26 16:56:37 +0200165 "vnc_bind_address": "0.0.0.0",
166 "vnc_port_max": "5956",
167 "vnc_port_min": "5956",
azvyagintsev0adfe682018-06-13 16:29:40 +0300168 "ssh_host_port_min": 7000,
169 "ssh_host_port_max": 7050,
Richard Felkld59c5652018-02-08 13:14:05 +0100170 "boot_wait": "2s",
azvyagintsev6d453852018-02-26 16:56:37 +0200171 "ssh_wait_timeout": "360s"
Richard Felkld59c5652018-02-08 13:14:05 +0100172 }
173 ]
azvyagintsev6d453852018-02-26 16:56:37 +0200174}