blob: 6c5f7b58c99c2daa9ac60bad1a01402f1162cd87 [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",
azvyagintsev0955f722018-07-13 21:01:19 +03005 "disk_size": "60000",
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 ],
azvyagintsev29410ee2018-07-12 20:02:30 +030082 "pause_before": "60s",
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",
azvyagintsev29410ee2018-07-12 20:02:30 +030095 "pause_before": "60s",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020096 "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",
azvyagintsev29410ee2018-07-12 20:02:30 +0300101 "scripts/cleanup_salt.sh",
azvyagintsev1726e802018-06-15 16:55:44 +0300102 "scripts/zerodisk.sh"
azvyagintsevc86fbaf2018-03-02 18:57:03 +0200103 ]
Richard Felkld59c5652018-02-08 13:14:05 +0100104 },
105 {
106 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +0200107 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +0100108 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
109 },
110 {
111 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +0200112 "source": "files/etc/cloud/cloud.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +0100113 "destination": "/etc/cloud/cloud.cfg"
114 }
115 ],
116 "builders": [
117 {
azvyagintsev6d453852018-02-26 16:56:37 +0200118 "type": "openstack",
119 "ssh_username": "{{user `user`}}",
120 "ssh_password": "{{user `password`}}",
121 "image_name": "{{user `image_name`}}",
Richard Felkl47757902018-03-02 22:44:43 +0100122 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
azvyagintsevc86fbaf2018-03-02 18:57:03 +0200123 "reuse_ips": "true",
Richard Felkl47757902018-03-02 22:44:43 +0100124 "source_image": "{{ user `os_image` }}",
125 "flavor": "{{ user `os_flavor` }}",
126 "user_data_file": "config-drive/user-data.yaml",
127 "tenant_id": "{{ user `os_tenant` }}",
128 "networks": ["{{ user `os_network` }}"],
129 "availability_zone": "{{user `os_zone`}}",
130 "identity_endpoint": "{{user `os_endpoint`}}",
131 "username": "{{user `os_username`}}",
132 "password": "{{user `os_password`}}"
azvyagintsev6d453852018-02-26 16:56:37 +0200133 },
134 {
Richard Felkld59c5652018-02-08 13:14:05 +0100135 "type": "qemu",
136 "qemuargs": [
137 [
138 "-m",
azvyagintsev6d453852018-02-26 16:56:37 +0200139 "8096M"
140 ],
141 [
142 "-fda",
143 "config-drive/cloudata.iso"
Richard Felkld59c5652018-02-08 13:14:05 +0100144 ],
145 [
146 "-smp",
147 "4"
148 ]
149 ],
azvyagintsev6d453852018-02-26 16:56:37 +0200150 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
151 "output_directory": "images/{{ user `image_name`}}",
Richard Felkld59c5652018-02-08 13:14:05 +0100152 "format": "qcow2",
153 "accelerator": "kvm",
154 "disk_size": "{{ user `disk_size`}}",
alexz8c4cfc72018-03-23 13:56:10 +0100155 "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 +0300156 "iso_target_path": "{{ user `images_cache`}}/release-20180306_xenial-server-cloudimg-amd64-disk1.img",
Richard Felkld59c5652018-02-08 13:14:05 +0100157 "iso_checksum_type": "md5",
azvyagintsev6d453852018-02-26 16:56:37 +0200158 "disk_image": true,
azvyagintsev0adfe682018-06-13 16:29:40 +0300159 "disk_compression": true,
alexz8c4cfc72018-03-23 13:56:10 +0100160 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
Richard Felkld59c5652018-02-08 13:14:05 +0100161 "http_directory": "http",
162 "headless": true,
163 "ssh_username": "{{user `user`}}",
164 "ssh_password": "{{user `password`}}",
azvyagintsevdd137842018-07-13 18:13:06 +0300165 "shutdown_command": "shutdown -P now",
azvyagintsev6d453852018-02-26 16:56:37 +0200166 "vnc_bind_address": "0.0.0.0",
167 "vnc_port_max": "5956",
168 "vnc_port_min": "5956",
azvyagintsev0adfe682018-06-13 16:29:40 +0300169 "ssh_host_port_min": 7000,
170 "ssh_host_port_max": 7050,
Richard Felkld59c5652018-02-08 13:14:05 +0100171 "boot_wait": "2s",
azvyagintsev6d453852018-02-26 16:56:37 +0200172 "ssh_wait_timeout": "360s"
Richard Felkld59c5652018-02-08 13:14:05 +0100173 }
174 ]
azvyagintsev6d453852018-02-26 16:56:37 +0200175}