blob: 3c1311786247bf737b7a6ec3935e2fd3e52c5595 [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` }}",
17 "apt_mirantis_gpg": "{{ env `APT_MIRANTIS_GPG` }}",
18 "apt_mirantis_salt_repo": "{{ env `APT_MIRANTIS_SALT_REPO` }}",
19 "git_salt_formulas_scripts": "{{ env `GIT_SALT_FORMULAS_SCRIPTS` }}",
20 "apt_repository": "{{ env `APT_REPOSITORY` }}",
Richard Felkl47757902018-03-02 22:44:43 +010021 "apt_repository_gpg": "{{ env `APT_REPOSITORY_GPG` }}",
Richard Felkl6d5bd492018-04-26 09:49:29 +020022 "os_flavor": "27574e15-f031-4b78-a82d-4cef3aea9442",
Richard Felkl47757902018-03-02 22:44:43 +010023 "os_username": "{{ env `OS_USERNAME` }}",
24 "os_password": "{{ env `OS_PASSWORD` }}",
azvyagintsev4053eb22018-03-29 16:21:51 +030025 "os_image": "7451fac0-0ce5-4d30-ae36-cd9a90e7948e",
26 "os_endpoint": "https://cloud-cz.bud.mirantis.net:5000/v2.0",
Richard Felkl47757902018-03-02 22:44:43 +010027 "os_zone": "mcp-mk",
28 "os_floating_ip_pool": "public",
29 "os_tenant": "26e4dd19485249608ee3685f254f3909",
30 "os_network": "772f8ca6-1f4a-4535-99d0-880d6ead9a82"
31
Richard Felkld59c5652018-02-08 13:14:05 +010032 },
33 "provisioners": [
34 {
azvyagintsev6d453852018-02-26 16:56:37 +020035 "type": "file",
36 "source": "files/root/interfaces",
37 "destination": "/root/interfaces"
38 },
39 {
40 "type": "file",
41 "source": "files/root/minion.conf",
42 "destination": "/root/minion.conf"
43 },
44 {
azvyagintsevc86fbaf2018-03-02 18:57:03 +020045 "type": "file",
46 "source": "files/tmp/bootstrap.saltstack.com.sh",
47 "destination": "/tmp/bootstrap.saltstack.com.sh"
48 },
49 {
Richard Felkld59c5652018-02-08 13:14:05 +010050 "environment_vars": [
51 "CLUSTER_MODEL={{ user `cluster_model` }}",
52 "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}",
53 "CLUSTER_NAME={{ user `cluster_name` }}",
azvyagintsevffa75b42018-06-06 20:38:54 +030054 "BS_HOSTNAME={{ user `bs_hostname` }}",
azvyagintsev6d453852018-02-26 16:56:37 +020055 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
56 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
57 "SALTSTACK_REPO={{ user `saltstack_repo` }}",
58 "APT_MIRANTIS_GPG={{ user `apt_mirantis_gpg` }}",
59 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
60 "GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}",
61 "APT_REPOSITORY={{ user `apt_repository` }}",
62 "APT_REPOSITORY_GPG={{ user `apt_repository_gpg` }}",
63 "PACKER_OFFLINE_BUILD=true"
Richard Felkld59c5652018-02-08 13:14:05 +010064 ],
65 "type": "shell",
Richard Felkl47757902018-03-02 22:44:43 +010066 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
Richard Felkld59c5652018-02-08 13:14:05 +010067 "expect_disconnect": "true",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020068 "scripts": [
69 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020070 "scripts/motd.sh",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020071 "scripts/network.sh",
Richard Felkl47757902018-03-02 22:44:43 +010072 "scripts/salt_bootstrap.sh",
73 "scripts/reboot.sh"
azvyagintsevc86fbaf2018-03-02 18:57:03 +020074 ]
Richard Felkld59c5652018-02-08 13:14:05 +010075 },
76 {
azvyagintsev6d453852018-02-26 16:56:37 +020077 "environment_vars": [
78 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}"
79 ],
azvyagintsev29410ee2018-07-12 20:02:30 +030080 "pause_before": "60s",
Richard Felkld59c5652018-02-08 13:14:05 +010081 "type": "shell",
82 "expect_disconnect": "true",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020083 "scripts": [
84 "scripts/salt.sh"
85 ]
Richard Felkld59c5652018-02-08 13:14:05 +010086 },
87 {
88 "environment_vars": [
89 "HOME=/root",
90 "MCP_VERSION={{ user `mcp_version` }}"
91 ],
92 "type": "shell",
azvyagintsev29410ee2018-07-12 20:02:30 +030093 "pause_before": "60s",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020094 "scripts": [
95 "scripts/mirrors.sh",
96 "scripts/security.sh",
azvyagintsev4053eb22018-03-29 16:21:51 +030097 "scripts/info.sh",
azvyagintsev1726e802018-06-15 16:55:44 +030098 "scripts/cleanup.sh",
azvyagintsev29410ee2018-07-12 20:02:30 +030099 "scripts/cleanup_salt.sh",
azvyagintsev1726e802018-06-15 16:55:44 +0300100 "scripts/zerodisk.sh"
azvyagintsevc86fbaf2018-03-02 18:57:03 +0200101 ]
Richard Felkld59c5652018-02-08 13:14:05 +0100102 },
103 {
104 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +0200105 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +0100106 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
107 },
108 {
109 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +0200110 "source": "files/etc/cloud/cloud.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +0100111 "destination": "/etc/cloud/cloud.cfg"
112 }
113 ],
114 "builders": [
115 {
azvyagintsev6d453852018-02-26 16:56:37 +0200116 "type": "openstack",
117 "ssh_username": "{{user `user`}}",
118 "ssh_password": "{{user `password`}}",
119 "image_name": "{{user `image_name`}}",
Richard Felkl47757902018-03-02 22:44:43 +0100120 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
azvyagintsevc86fbaf2018-03-02 18:57:03 +0200121 "reuse_ips": "true",
Richard Felkl47757902018-03-02 22:44:43 +0100122 "source_image": "{{ user `os_image` }}",
123 "flavor": "{{ user `os_flavor` }}",
124 "user_data_file": "config-drive/user-data.yaml",
125 "tenant_id": "{{ user `os_tenant` }}",
126 "networks": ["{{ user `os_network` }}"],
127 "availability_zone": "{{user `os_zone`}}",
128 "identity_endpoint": "{{user `os_endpoint`}}",
129 "username": "{{user `os_username`}}",
130 "password": "{{user `os_password`}}"
azvyagintsev6d453852018-02-26 16:56:37 +0200131 },
132 {
Richard Felkld59c5652018-02-08 13:14:05 +0100133 "type": "qemu",
134 "qemuargs": [
135 [
136 "-m",
azvyagintsev6d453852018-02-26 16:56:37 +0200137 "8096M"
138 ],
139 [
Ivan Berezovskiy23035a22018-11-14 13:25:51 +0400140 "-cdrom",
azvyagintsev6d453852018-02-26 16:56:37 +0200141 "config-drive/cloudata.iso"
Richard Felkld59c5652018-02-08 13:14:05 +0100142 ],
143 [
144 "-smp",
145 "4"
azvyagintsev262b28c2018-10-23 18:38:42 +0300146 ],
147 ["-device", "virtio-net,netdev=user.0"],
148 ["-object","rng-random,id=objrng0,filename=/dev/urandom"],
149 ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10" ]
Richard Felkld59c5652018-02-08 13:14:05 +0100150 ],
azvyagintsev6d453852018-02-26 16:56:37 +0200151 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
azvyagintsevf87bbb82018-09-03 16:45:33 +0300152 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
Richard Felkld59c5652018-02-08 13:14:05 +0100153 "format": "qcow2",
154 "accelerator": "kvm",
155 "disk_size": "{{ user `disk_size`}}",
alexz8c4cfc72018-03-23 13:56:10 +0100156 "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 +0300157 "iso_target_path": "{{ user `images_cache`}}/release-20180306_xenial-server-cloudimg-amd64-disk1.img",
Richard Felkld59c5652018-02-08 13:14:05 +0100158 "iso_checksum_type": "md5",
azvyagintsev6d453852018-02-26 16:56:37 +0200159 "disk_image": true,
azvyagintsev0adfe682018-06-13 16:29:40 +0300160 "disk_compression": true,
alexz8c4cfc72018-03-23 13:56:10 +0100161 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
Richard Felkld59c5652018-02-08 13:14:05 +0100162 "http_directory": "http",
163 "headless": true,
164 "ssh_username": "{{user `user`}}",
165 "ssh_password": "{{user `password`}}",
azvyagintsevdd137842018-07-13 18:13:06 +0300166 "shutdown_command": "shutdown -P now",
azvyagintsev6d453852018-02-26 16:56:37 +0200167 "vnc_bind_address": "0.0.0.0",
168 "vnc_port_max": "5956",
169 "vnc_port_min": "5956",
azvyagintsev0adfe682018-06-13 16:29:40 +0300170 "ssh_host_port_min": 7000,
171 "ssh_host_port_max": 7050,
Richard Felkld59c5652018-02-08 13:14:05 +0100172 "boot_wait": "2s",
azvyagintsev6d453852018-02-26 16:56:37 +0200173 "ssh_wait_timeout": "360s"
Richard Felkld59c5652018-02-08 13:14:05 +0100174 }
175 ]
azvyagintsev6d453852018-02-26 16:56:37 +0200176}