blob: fd65d1e85cf2c3429e6c6a02952df09ea2f9fc8e [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",
Richard Felkld59c5652018-02-08 13:14:05 +01005 "do_api_token": "{{ env `DO_API_TOKEN` }}",
azvyagintsev6d453852018-02-26 16:56:37 +02006 "image_name": "{{ env `IMAGE_NAME` }}",
Richard Felkld59c5652018-02-08 13:14:05 +01007 "disk_size": "150000",
8 "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` }}",
21 "os_endpoint": "https://cloud-cz.bud.mirantis.net:5000/v2.0",
22 "os_flavor": "56c551be-41c0-49a4-b367-9b31691c32c3",
23 "os_username": "{{ env `OS_USERNAME` }}",
24 "os_password": "{{ env `OS_PASSWORD` }}",
25 "os_image": "60878bd4-cb4a-4d71-ae02-2a8ee4476d10",
26 "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",
96 "scripts/cleanup.sh"
97 ]
Richard Felkld59c5652018-02-08 13:14:05 +010098 },
99 {
100 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +0200101 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +0100102 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
103 },
104 {
105 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +0200106 "source": "files/etc/cloud/cloud.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +0100107 "destination": "/etc/cloud/cloud.cfg"
108 }
109 ],
110 "builders": [
111 {
azvyagintsev6d453852018-02-26 16:56:37 +0200112 "type": "openstack",
113 "ssh_username": "{{user `user`}}",
114 "ssh_password": "{{user `password`}}",
115 "image_name": "{{user `image_name`}}",
Richard Felkl47757902018-03-02 22:44:43 +0100116 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
azvyagintsevc86fbaf2018-03-02 18:57:03 +0200117 "reuse_ips": "true",
Richard Felkl47757902018-03-02 22:44:43 +0100118 "source_image": "{{ user `os_image` }}",
119 "flavor": "{{ user `os_flavor` }}",
120 "user_data_file": "config-drive/user-data.yaml",
121 "tenant_id": "{{ user `os_tenant` }}",
122 "networks": ["{{ user `os_network` }}"],
123 "availability_zone": "{{user `os_zone`}}",
124 "identity_endpoint": "{{user `os_endpoint`}}",
125 "username": "{{user `os_username`}}",
126 "password": "{{user `os_password`}}"
azvyagintsev6d453852018-02-26 16:56:37 +0200127 },
128 {
Richard Felkld59c5652018-02-08 13:14:05 +0100129 "type": "qemu",
130 "qemuargs": [
131 [
132 "-m",
azvyagintsev6d453852018-02-26 16:56:37 +0200133 "8096M"
134 ],
135 [
136 "-fda",
137 "config-drive/cloudata.iso"
Richard Felkld59c5652018-02-08 13:14:05 +0100138 ],
139 [
140 "-smp",
141 "4"
142 ]
143 ],
azvyagintsev6d453852018-02-26 16:56:37 +0200144 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
145 "output_directory": "images/{{ user `image_name`}}",
Richard Felkld59c5652018-02-08 13:14:05 +0100146 "format": "qcow2",
147 "accelerator": "kvm",
148 "disk_size": "{{ user `disk_size`}}",
alexz8c4cfc72018-03-23 13:56:10 +0100149 "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 +0200150 "iso_target_path": "/root/isos/xenial-server-cloudimg-amd64-disk1.img",
Richard Felkld59c5652018-02-08 13:14:05 +0100151 "iso_checksum_type": "md5",
azvyagintsev6d453852018-02-26 16:56:37 +0200152 "disk_image": true,
alexz8c4cfc72018-03-23 13:56:10 +0100153 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
Richard Felkld59c5652018-02-08 13:14:05 +0100154 "http_directory": "http",
155 "headless": true,
156 "ssh_username": "{{user `user`}}",
157 "ssh_password": "{{user `password`}}",
azvyagintsev6d453852018-02-26 16:56:37 +0200158 "shutdown_command": "sync; shutdown -P now",
159 "vnc_bind_address": "0.0.0.0",
160 "vnc_port_max": "5956",
161 "vnc_port_min": "5956",
162 "ssh_host_port_min": 2223,
163 "ssh_host_port_max": 2223,
Richard Felkld59c5652018-02-08 13:14:05 +0100164 "boot_wait": "2s",
azvyagintsev6d453852018-02-26 16:56:37 +0200165 "ssh_wait_timeout": "360s"
Richard Felkld59c5652018-02-08 13:14:05 +0100166 }
167 ]
azvyagintsev6d453852018-02-26 16:56:37 +0200168}