blob: 1bd1360269cfcd91e15a820b53ac95160aad82fa [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` }}",
7 "VM_IMAGE": "{{ env `VM_IMAGE` }}",
8 "floating_ip_pool": "{{ env `VM_FLOATING_IP_POOL` }}",
9 "VM_FLAVOR" : "{{ env `VM_FLAVOR` }}",
Richard Felkld59c5652018-02-08 13:14:05 +010010 "disk_size": "150000",
11 "cluster_model": "{{ env `CLUSTER_MODEL` }}",
12 "cluster_model_ref": "{{ env `CLUSTER_MODEL_REF` }}",
13 "cluster_name": "{{ env `CLUSTER_NAME` }}",
14 "formula_version": "{{ env `FORMULA_VERSION` }}",
azvyagintsev6d453852018-02-26 16:56:37 +020015 "mcp_version": "{{ env `MCP_VERSION` }}",
16 "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}",
17 "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
18 "saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
19 "apt_mirantis_gpg": "{{ env `APT_MIRANTIS_GPG` }}",
20 "apt_mirantis_salt_repo": "{{ env `APT_MIRANTIS_SALT_REPO` }}",
21 "git_salt_formulas_scripts": "{{ env `GIT_SALT_FORMULAS_SCRIPTS` }}",
22 "apt_repository": "{{ env `APT_REPOSITORY` }}",
23 "apt_repository_gpg": "{{ env `APT_REPOSITORY_GPG` }}"
Richard Felkld59c5652018-02-08 13:14:05 +010024 },
25 "provisioners": [
26 {
azvyagintsev6d453852018-02-26 16:56:37 +020027 "type": "file",
28 "source": "files/root/interfaces",
29 "destination": "/root/interfaces"
30 },
31 {
32 "type": "file",
33 "source": "files/root/minion.conf",
34 "destination": "/root/minion.conf"
35 },
36 {
Richard Felkld59c5652018-02-08 13:14:05 +010037 "environment_vars": [
38 "CLUSTER_MODEL={{ user `cluster_model` }}",
39 "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}",
40 "CLUSTER_NAME={{ user `cluster_name` }}",
azvyagintsev6d453852018-02-26 16:56:37 +020041 "FORMULA_VERSION={{ user `formula_version` }}",
42 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
43 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
44 "SALTSTACK_REPO={{ user `saltstack_repo` }}",
45 "APT_MIRANTIS_GPG={{ user `apt_mirantis_gpg` }}",
46 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
47 "GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}",
48 "APT_REPOSITORY={{ user `apt_repository` }}",
49 "APT_REPOSITORY_GPG={{ user `apt_repository_gpg` }}",
50 "PACKER_OFFLINE_BUILD=true"
Richard Felkld59c5652018-02-08 13:14:05 +010051 ],
52 "type": "shell",
53 "expect_disconnect": "true",
54 "override": {
azvyagintsev6d453852018-02-26 16:56:37 +020055 "openstack": {
56 "scripts": [
57 "scripts/base.sh",
58 "scripts/network.sh",
59 "scripts/salt_bootstrap.sh",
60 "scripts/salt.sh"
61 ]
62 },
Richard Felkld59c5652018-02-08 13:14:05 +010063 "qemu": {
64 "scripts": [
65 "scripts/base.sh",
66 "scripts/network.sh",
azvyagintsev6d453852018-02-26 16:56:37 +020067 "scripts/salt_bootstrap.sh",
Richard Felkld59c5652018-02-08 13:14:05 +010068 "scripts/salt.sh"
69 ]
70 }
71 }
72 },
73 {
azvyagintsev6d453852018-02-26 16:56:37 +020074 "environment_vars": [
75 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}"
76 ],
Richard Felkld59c5652018-02-08 13:14:05 +010077 "type": "shell",
78 "expect_disconnect": "true",
azvyagintsev6d453852018-02-26 16:56:37 +020079 "override": {
80 "openstack": {
81 "scripts": [
82 "scripts/salt.sh"
83 ]
84 },
85 "qemu": {
86 "scripts": [
87 "scripts/salt.sh"
88 ]
89 }
90 }
Richard Felkld59c5652018-02-08 13:14:05 +010091 },
92 {
93 "environment_vars": [
94 "HOME=/root",
95 "MCP_VERSION={{ user `mcp_version` }}"
96 ],
97 "type": "shell",
98 "pause_before": "180s",
99 "override": {
azvyagintsev6d453852018-02-26 16:56:37 +0200100 "openstack": {
101 "scripts": [
102 "scripts/mirrors.sh",
103 "scripts/security.sh",
104 "scripts/cleanup.sh"
105 ]
106 },
Richard Felkld59c5652018-02-08 13:14:05 +0100107 "qemu": {
108 "scripts": [
109 "scripts/mirrors.sh",
110 "scripts/security.sh",
111 "scripts/cleanup.sh"
112 ]
113 }
114 }
115 },
116 {
117 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +0200118 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +0100119 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
120 },
121 {
122 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +0200123 "source": "files/etc/cloud/cloud.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +0100124 "destination": "/etc/cloud/cloud.cfg"
125 }
126 ],
127 "builders": [
128 {
azvyagintsev6d453852018-02-26 16:56:37 +0200129 "type": "openstack",
130 "ssh_username": "{{user `user`}}",
131 "ssh_password": "{{user `password`}}",
132 "image_name": "{{user `image_name`}}",
133 "floating_ip_pool": "{{user `floating_ip_pool`}}",
134 "reuse_ips" : "true",
135 "security_groups": [
136 "open_all"
137 ],
138 "source_image": "{{ user `VM_IMAGE` }}",
139 "flavor": "{{ user `VM_FLAVOR` }}",
140 "user_data_file": "config-drive/user-data.yaml"
141 },
142 {
Richard Felkld59c5652018-02-08 13:14:05 +0100143 "type": "qemu",
144 "qemuargs": [
145 [
146 "-m",
azvyagintsev6d453852018-02-26 16:56:37 +0200147 "8096M"
148 ],
149 [
150 "-fda",
151 "config-drive/cloudata.iso"
Richard Felkld59c5652018-02-08 13:14:05 +0100152 ],
153 [
154 "-smp",
155 "4"
156 ]
157 ],
azvyagintsev6d453852018-02-26 16:56:37 +0200158 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
159 "output_directory": "images/{{ user `image_name`}}",
Richard Felkld59c5652018-02-08 13:14:05 +0100160 "format": "qcow2",
161 "accelerator": "kvm",
162 "disk_size": "{{ user `disk_size`}}",
azvyagintsev6d453852018-02-26 16:56:37 +0200163 "iso_url": "http://cloud-images.ubuntu.com/xenial/20180224/xenial-server-cloudimg-amd64-disk1.img",
164 "iso_target_path": "/root/isos/xenial-server-cloudimg-amd64-disk1.img",
Richard Felkld59c5652018-02-08 13:14:05 +0100165 "iso_checksum_type": "md5",
azvyagintsev6d453852018-02-26 16:56:37 +0200166 "disk_image": true,
167 "iso_checksum": "697d8f9058ad118cea699d14ae414f8b",
Richard Felkld59c5652018-02-08 13:14:05 +0100168 "http_directory": "http",
169 "headless": true,
170 "ssh_username": "{{user `user`}}",
171 "ssh_password": "{{user `password`}}",
azvyagintsev6d453852018-02-26 16:56:37 +0200172 "shutdown_command": "sync; shutdown -P now",
173 "vnc_bind_address": "0.0.0.0",
174 "vnc_port_max": "5956",
175 "vnc_port_min": "5956",
176 "ssh_host_port_min": 2223,
177 "ssh_host_port_max": 2223,
Richard Felkld59c5652018-02-08 13:14:05 +0100178 "boot_wait": "2s",
azvyagintsev6d453852018-02-26 16:56:37 +0200179 "ssh_wait_timeout": "360s"
Richard Felkld59c5652018-02-08 13:14:05 +0100180 }
181 ]
azvyagintsev6d453852018-02-26 16:56:37 +0200182}