blob: 94e9b6949183c87cd99894261085a56e4b33ecc0 [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",
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` }}",
Ivan Berezovskiy7630eaf2018-12-17 16:33:14 +040017 "apt_mirantis_gpg": "{{ env `APT_MIRANTIS_SALT_GPG` }}",
azvyagintsev6d453852018-02-26 16:56:37 +020018 "apt_mirantis_salt_repo": "{{ env `APT_MIRANTIS_SALT_REPO` }}",
19 "git_salt_formulas_scripts": "{{ env `GIT_SALT_FORMULAS_SCRIPTS` }}",
Richard Felkl6d5bd492018-04-26 09:49:29 +020020 "os_flavor": "27574e15-f031-4b78-a82d-4cef3aea9442",
Richard Felkl47757902018-03-02 22:44:43 +010021 "os_username": "{{ env `OS_USERNAME` }}",
22 "os_password": "{{ env `OS_PASSWORD` }}",
azvyagintsev4053eb22018-03-29 16:21:51 +030023 "os_image": "7451fac0-0ce5-4d30-ae36-cd9a90e7948e",
24 "os_endpoint": "https://cloud-cz.bud.mirantis.net:5000/v2.0",
Richard Felkl47757902018-03-02 22:44:43 +010025 "os_zone": "mcp-mk",
26 "os_floating_ip_pool": "public",
27 "os_tenant": "26e4dd19485249608ee3685f254f3909",
28 "os_network": "772f8ca6-1f4a-4535-99d0-880d6ead9a82"
29
Richard Felkld59c5652018-02-08 13:14:05 +010030 },
31 "provisioners": [
32 {
azvyagintsev6d453852018-02-26 16:56:37 +020033 "type": "file",
34 "source": "files/root/interfaces",
35 "destination": "/root/interfaces"
36 },
37 {
38 "type": "file",
39 "source": "files/root/minion.conf",
40 "destination": "/root/minion.conf"
41 },
42 {
azvyagintsevc86fbaf2018-03-02 18:57:03 +020043 "type": "file",
44 "source": "files/tmp/bootstrap.saltstack.com.sh",
45 "destination": "/tmp/bootstrap.saltstack.com.sh"
46 },
47 {
Richard Felkld59c5652018-02-08 13:14:05 +010048 "environment_vars": [
49 "CLUSTER_MODEL={{ user `cluster_model` }}",
50 "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}",
51 "CLUSTER_NAME={{ user `cluster_name` }}",
azvyagintsevffa75b42018-06-06 20:38:54 +030052 "BS_HOSTNAME={{ user `bs_hostname` }}",
azvyagintsev6d453852018-02-26 16:56:37 +020053 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
54 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
55 "SALTSTACK_REPO={{ user `saltstack_repo` }}",
Ivan Berezovskiy7630eaf2018-12-17 16:33:14 +040056 "APT_MIRANTIS_SALT_GPG={{ user `apt_mirantis_gpg` }}",
azvyagintsev6d453852018-02-26 16:56:37 +020057 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
58 "GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}",
azvyagintsev2a25cb72019-02-07 15:30:51 +020059 "PACKER_OFFLINE_BUILD=true",
60 "MCP_VERSION={{ user `mcp_version` }}"
Richard Felkld59c5652018-02-08 13:14:05 +010061 ],
62 "type": "shell",
Richard Felkl47757902018-03-02 22:44:43 +010063 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
Richard Felkld59c5652018-02-08 13:14:05 +010064 "expect_disconnect": "true",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020065 "scripts": [
66 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020067 "scripts/motd.sh",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020068 "scripts/network.sh",
Richard Felkl47757902018-03-02 22:44:43 +010069 "scripts/salt_bootstrap.sh",
70 "scripts/reboot.sh"
azvyagintsevc86fbaf2018-03-02 18:57:03 +020071 ]
Richard Felkld59c5652018-02-08 13:14:05 +010072 },
73 {
azvyagintsev6d453852018-02-26 16:56:37 +020074 "environment_vars": [
75 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}"
76 ],
azvyagintsev29410ee2018-07-12 20:02:30 +030077 "pause_before": "60s",
Richard Felkld59c5652018-02-08 13:14:05 +010078 "type": "shell",
79 "expect_disconnect": "true",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020080 "scripts": [
81 "scripts/salt.sh"
82 ]
Richard Felkld59c5652018-02-08 13:14:05 +010083 },
84 {
85 "environment_vars": [
86 "HOME=/root",
87 "MCP_VERSION={{ user `mcp_version` }}"
88 ],
89 "type": "shell",
azvyagintsev29410ee2018-07-12 20:02:30 +030090 "pause_before": "60s",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020091 "scripts": [
92 "scripts/mirrors.sh",
93 "scripts/security.sh",
azvyagintsev4053eb22018-03-29 16:21:51 +030094 "scripts/info.sh",
azvyagintsev1726e802018-06-15 16:55:44 +030095 "scripts/cleanup.sh",
Vladimir Khlyunevaf648d32021-05-17 13:19:44 +040096 "scripts/cleanup_salt.sh"
azvyagintsevc86fbaf2018-03-02 18:57:03 +020097 ]
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"
Vladimir Khlyunevaf648d32021-05-17 13:19:44 +0400108 },
109 {
110 "type": "file",
111 "source": "files/usr/local/bin/dockerswarm_cert.sh",
112 "destination": "/tmp/dockerswarm_cert.sh"
113 },
114 {
115 "type": "shell",
116 "inline": ["mkdir -p /usr/local/bin",
117 "mv /tmp/dockerswarm_cert.sh /usr/local/bin/dockerswarm_cert.sh",
118 "chmod +x /usr/local/bin/dockerswarm_cert.sh"]
119 },
120 {
121 "type": "file",
122 "source": "files/etc/systemd/system/dockerswarm_cert.service",
123 "destination": "/etc/systemd/system/dockerswarm_cert.service"
124 },
125 {
126 "type": "shell",
127 "inline": ["systemctl enable dockerswarm_cert.service"]
128 },
129 {
130 "type": "shell",
131 "pause_before": "60s",
132 "scripts": ["scripts/flush_disk.sh"]
Richard Felkld59c5652018-02-08 13:14:05 +0100133 }
134 ],
135 "builders": [
136 {
azvyagintsev6d453852018-02-26 16:56:37 +0200137 "type": "openstack",
138 "ssh_username": "{{user `user`}}",
139 "ssh_password": "{{user `password`}}",
140 "image_name": "{{user `image_name`}}",
Richard Felkl47757902018-03-02 22:44:43 +0100141 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
azvyagintsevc86fbaf2018-03-02 18:57:03 +0200142 "reuse_ips": "true",
Richard Felkl47757902018-03-02 22:44:43 +0100143 "source_image": "{{ user `os_image` }}",
144 "flavor": "{{ user `os_flavor` }}",
145 "user_data_file": "config-drive/user-data.yaml",
146 "tenant_id": "{{ user `os_tenant` }}",
147 "networks": ["{{ user `os_network` }}"],
148 "availability_zone": "{{user `os_zone`}}",
149 "identity_endpoint": "{{user `os_endpoint`}}",
150 "username": "{{user `os_username`}}",
151 "password": "{{user `os_password`}}"
azvyagintsev6d453852018-02-26 16:56:37 +0200152 },
153 {
Richard Felkld59c5652018-02-08 13:14:05 +0100154 "type": "qemu",
155 "qemuargs": [
156 [
157 "-m",
azvyagintsev6d453852018-02-26 16:56:37 +0200158 "8096M"
159 ],
160 [
Ivan Berezovskiy23035a22018-11-14 13:25:51 +0400161 "-cdrom",
azvyagintsev6d453852018-02-26 16:56:37 +0200162 "config-drive/cloudata.iso"
Richard Felkld59c5652018-02-08 13:14:05 +0100163 ],
164 [
165 "-smp",
azvyagintsev5c4e2d62018-12-29 19:12:32 +0200166 "8"
azvyagintsev262b28c2018-10-23 18:38:42 +0300167 ],
168 ["-device", "virtio-net,netdev=user.0"],
169 ["-object","rng-random,id=objrng0,filename=/dev/urandom"],
170 ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10" ]
Richard Felkld59c5652018-02-08 13:14:05 +0100171 ],
Aleksey Zvyagintsev42e76952018-12-14 13:40:44 +0000172 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}.qcow2",
azvyagintsevf87bbb82018-09-03 16:45:33 +0300173 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
Aleksey Zvyagintsev42e76952018-12-14 13:40:44 +0000174 "disk_compression": true,
175 "disk_size": "{{ user `disk_size`}}",
Richard Felkld59c5652018-02-08 13:14:05 +0100176 "format": "qcow2",
177 "accelerator": "kvm",
alexz8c4cfc72018-03-23 13:56:10 +0100178 "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 +0300179 "iso_target_path": "{{ user `images_cache`}}/release-20180306_xenial-server-cloudimg-amd64-disk1.img",
Richard Felkld59c5652018-02-08 13:14:05 +0100180 "iso_checksum_type": "md5",
azvyagintsev6d453852018-02-26 16:56:37 +0200181 "disk_image": true,
alexz8c4cfc72018-03-23 13:56:10 +0100182 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
Richard Felkld59c5652018-02-08 13:14:05 +0100183 "http_directory": "http",
184 "headless": true,
185 "ssh_username": "{{user `user`}}",
186 "ssh_password": "{{user `password`}}",
azvyagintsevdd137842018-07-13 18:13:06 +0300187 "shutdown_command": "shutdown -P now",
azvyagintsev6d453852018-02-26 16:56:37 +0200188 "vnc_bind_address": "0.0.0.0",
189 "vnc_port_max": "5956",
190 "vnc_port_min": "5956",
azvyagintsev0adfe682018-06-13 16:29:40 +0300191 "ssh_host_port_min": 7000,
192 "ssh_host_port_max": 7050,
Richard Felkld59c5652018-02-08 13:14:05 +0100193 "boot_wait": "2s",
azvyagintsev6d453852018-02-26 16:56:37 +0200194 "ssh_wait_timeout": "360s"
Richard Felkld59c5652018-02-08 13:14:05 +0100195 }
196 ]
azvyagintsev6d453852018-02-26 16:56:37 +0200197}