blob: b48c15db16e01ad42d7c10666a0ae3cca0d22d47 [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` }}",
11 "formula_version": "{{ env `FORMULA_VERSION` }}",
azvyagintsev6d453852018-02-26 16:56:37 +020012 "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 Felkl47757902018-03-02 22:44:43 +010020 "apt_repository_gpg": "{{ env `APT_REPOSITORY_GPG` }}",
Richard Felkl6d5bd492018-04-26 09:49:29 +020021 "os_flavor": "27574e15-f031-4b78-a82d-4cef3aea9442",
Richard Felkl47757902018-03-02 22:44:43 +010022 "os_username": "{{ env `OS_USERNAME` }}",
23 "os_password": "{{ env `OS_PASSWORD` }}",
azvyagintsev4053eb22018-03-29 16:21:51 +030024 "os_image": "7451fac0-0ce5-4d30-ae36-cd9a90e7948e",
25 "os_endpoint": "https://cloud-cz.bud.mirantis.net:5000/v2.0",
Richard Felkl47757902018-03-02 22:44:43 +010026 "os_zone": "mcp-mk",
27 "os_floating_ip_pool": "public",
28 "os_tenant": "26e4dd19485249608ee3685f254f3909",
29 "os_network": "772f8ca6-1f4a-4535-99d0-880d6ead9a82"
30
Richard Felkld59c5652018-02-08 13:14:05 +010031 },
32 "provisioners": [
33 {
azvyagintsev6d453852018-02-26 16:56:37 +020034 "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 {
azvyagintsevc86fbaf2018-03-02 18:57:03 +020044 "type": "file",
45 "source": "files/tmp/bootstrap.saltstack.com.sh",
46 "destination": "/tmp/bootstrap.saltstack.com.sh"
47 },
48 {
Richard Felkld59c5652018-02-08 13:14:05 +010049 "environment_vars": [
50 "CLUSTER_MODEL={{ user `cluster_model` }}",
51 "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}",
52 "CLUSTER_NAME={{ user `cluster_name` }}",
azvyagintsev6d453852018-02-26 16:56:37 +020053 "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 Felkld59c5652018-02-08 13:14:05 +010063 ],
64 "type": "shell",
Richard Felkl47757902018-03-02 22:44:43 +010065 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
Richard Felkld59c5652018-02-08 13:14:05 +010066 "expect_disconnect": "true",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020067 "scripts": [
68 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020069 "scripts/motd.sh",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020070 "scripts/network.sh",
Richard Felkl47757902018-03-02 22:44:43 +010071 "scripts/salt_bootstrap.sh",
72 "scripts/reboot.sh"
azvyagintsevc86fbaf2018-03-02 18:57:03 +020073 ]
Richard Felkld59c5652018-02-08 13:14:05 +010074 },
75 {
azvyagintsev6d453852018-02-26 16:56:37 +020076 "environment_vars": [
77 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}"
78 ],
Richard Felkl47757902018-03-02 22:44:43 +010079 "pause_before": "120s",
Richard Felkld59c5652018-02-08 13:14:05 +010080 "type": "shell",
81 "expect_disconnect": "true",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020082 "scripts": [
83 "scripts/salt.sh"
84 ]
Richard Felkld59c5652018-02-08 13:14:05 +010085 },
86 {
87 "environment_vars": [
88 "HOME=/root",
89 "MCP_VERSION={{ user `mcp_version` }}"
90 ],
91 "type": "shell",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020092 "pause_before": "120s",
93 "scripts": [
94 "scripts/mirrors.sh",
95 "scripts/security.sh",
azvyagintsev4053eb22018-03-29 16:21:51 +030096 "scripts/info.sh",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020097 "scripts/cleanup.sh"
98 ]
Richard Felkld59c5652018-02-08 13:14:05 +010099 },
100 {
101 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +0200102 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +0100103 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
104 },
105 {
106 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +0200107 "source": "files/etc/cloud/cloud.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +0100108 "destination": "/etc/cloud/cloud.cfg"
109 }
110 ],
111 "builders": [
112 {
azvyagintsev6d453852018-02-26 16:56:37 +0200113 "type": "openstack",
114 "ssh_username": "{{user `user`}}",
115 "ssh_password": "{{user `password`}}",
116 "image_name": "{{user `image_name`}}",
Richard Felkl47757902018-03-02 22:44:43 +0100117 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
azvyagintsevc86fbaf2018-03-02 18:57:03 +0200118 "reuse_ips": "true",
Richard Felkl47757902018-03-02 22:44:43 +0100119 "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`}}"
azvyagintsev6d453852018-02-26 16:56:37 +0200128 },
129 {
Richard Felkld59c5652018-02-08 13:14:05 +0100130 "type": "qemu",
131 "qemuargs": [
132 [
133 "-m",
azvyagintsev6d453852018-02-26 16:56:37 +0200134 "8096M"
135 ],
136 [
137 "-fda",
138 "config-drive/cloudata.iso"
Richard Felkld59c5652018-02-08 13:14:05 +0100139 ],
140 [
141 "-smp",
142 "4"
143 ]
144 ],
azvyagintsev6d453852018-02-26 16:56:37 +0200145 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
146 "output_directory": "images/{{ user `image_name`}}",
Richard Felkld59c5652018-02-08 13:14:05 +0100147 "format": "qcow2",
148 "accelerator": "kvm",
149 "disk_size": "{{ user `disk_size`}}",
alexz8c4cfc72018-03-23 13:56:10 +0100150 "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 +0200151 "iso_target_path": "/root/isos/xenial-server-cloudimg-amd64-disk1.img",
Richard Felkld59c5652018-02-08 13:14:05 +0100152 "iso_checksum_type": "md5",
azvyagintsev6d453852018-02-26 16:56:37 +0200153 "disk_image": true,
alexz8c4cfc72018-03-23 13:56:10 +0100154 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
Richard Felkld59c5652018-02-08 13:14:05 +0100155 "http_directory": "http",
156 "headless": true,
157 "ssh_username": "{{user `user`}}",
158 "ssh_password": "{{user `password`}}",
azvyagintsev6d453852018-02-26 16:56:37 +0200159 "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 Felkld59c5652018-02-08 13:14:05 +0100165 "boot_wait": "2s",
azvyagintsev6d453852018-02-26 16:56:37 +0200166 "ssh_wait_timeout": "360s"
Richard Felkld59c5652018-02-08 13:14:05 +0100167 }
168 ]
azvyagintsev6d453852018-02-26 16:56:37 +0200169}