blob: 711f7ed2a7776424491395ed8b8f974e27b9a1ac [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` }}",
azvyagintsev6d453852018-02-26 16:56:37 +020059 "PACKER_OFFLINE_BUILD=true"
Richard Felkld59c5652018-02-08 13:14:05 +010060 ],
61 "type": "shell",
Richard Felkl47757902018-03-02 22:44:43 +010062 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
Richard Felkld59c5652018-02-08 13:14:05 +010063 "expect_disconnect": "true",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020064 "scripts": [
65 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020066 "scripts/motd.sh",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020067 "scripts/network.sh",
Richard Felkl47757902018-03-02 22:44:43 +010068 "scripts/salt_bootstrap.sh",
69 "scripts/reboot.sh"
azvyagintsevc86fbaf2018-03-02 18:57:03 +020070 ]
Richard Felkld59c5652018-02-08 13:14:05 +010071 },
72 {
azvyagintsev6d453852018-02-26 16:56:37 +020073 "environment_vars": [
74 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}"
75 ],
azvyagintsev29410ee2018-07-12 20:02:30 +030076 "pause_before": "60s",
Richard Felkld59c5652018-02-08 13:14:05 +010077 "type": "shell",
78 "expect_disconnect": "true",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020079 "scripts": [
80 "scripts/salt.sh"
81 ]
Richard Felkld59c5652018-02-08 13:14:05 +010082 },
83 {
84 "environment_vars": [
85 "HOME=/root",
86 "MCP_VERSION={{ user `mcp_version` }}"
87 ],
88 "type": "shell",
azvyagintsev29410ee2018-07-12 20:02:30 +030089 "pause_before": "60s",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020090 "scripts": [
91 "scripts/mirrors.sh",
92 "scripts/security.sh",
azvyagintsev4053eb22018-03-29 16:21:51 +030093 "scripts/info.sh",
azvyagintsev1726e802018-06-15 16:55:44 +030094 "scripts/cleanup.sh",
azvyagintsev29410ee2018-07-12 20:02:30 +030095 "scripts/cleanup_salt.sh",
azvyagintsev1726e802018-06-15 16:55:44 +030096 "scripts/zerodisk.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"
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 [
Ivan Berezovskiy23035a22018-11-14 13:25:51 +0400136 "-cdrom",
azvyagintsev6d453852018-02-26 16:56:37 +0200137 "config-drive/cloudata.iso"
Richard Felkld59c5652018-02-08 13:14:05 +0100138 ],
139 [
140 "-smp",
azvyagintsev5c4e2d62018-12-29 19:12:32 +0200141 "8"
azvyagintsev262b28c2018-10-23 18:38:42 +0300142 ],
143 ["-device", "virtio-net,netdev=user.0"],
144 ["-object","rng-random,id=objrng0,filename=/dev/urandom"],
145 ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10" ]
Richard Felkld59c5652018-02-08 13:14:05 +0100146 ],
Aleksey Zvyagintsev42e76952018-12-14 13:40:44 +0000147 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}.qcow2",
azvyagintsevf87bbb82018-09-03 16:45:33 +0300148 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
Aleksey Zvyagintsev42e76952018-12-14 13:40:44 +0000149 "disk_compression": true,
150 "disk_size": "{{ user `disk_size`}}",
Richard Felkld59c5652018-02-08 13:14:05 +0100151 "format": "qcow2",
152 "accelerator": "kvm",
alexz8c4cfc72018-03-23 13:56:10 +0100153 "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 +0300154 "iso_target_path": "{{ user `images_cache`}}/release-20180306_xenial-server-cloudimg-amd64-disk1.img",
Richard Felkld59c5652018-02-08 13:14:05 +0100155 "iso_checksum_type": "md5",
azvyagintsev6d453852018-02-26 16:56:37 +0200156 "disk_image": true,
alexz8c4cfc72018-03-23 13:56:10 +0100157 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
Richard Felkld59c5652018-02-08 13:14:05 +0100158 "http_directory": "http",
159 "headless": true,
160 "ssh_username": "{{user `user`}}",
161 "ssh_password": "{{user `password`}}",
azvyagintsevdd137842018-07-13 18:13:06 +0300162 "shutdown_command": "shutdown -P now",
azvyagintsev6d453852018-02-26 16:56:37 +0200163 "vnc_bind_address": "0.0.0.0",
164 "vnc_port_max": "5956",
165 "vnc_port_min": "5956",
azvyagintsev0adfe682018-06-13 16:29:40 +0300166 "ssh_host_port_min": 7000,
167 "ssh_host_port_max": 7050,
Richard Felkld59c5652018-02-08 13:14:05 +0100168 "boot_wait": "2s",
azvyagintsev6d453852018-02-26 16:56:37 +0200169 "ssh_wait_timeout": "360s"
Richard Felkld59c5652018-02-08 13:14:05 +0100170 }
171 ]
azvyagintsev6d453852018-02-26 16:56:37 +0200172}