blob: 13a14068728fb43c66fadc29ecde646cb40ee8e6 [file] [log] [blame]
Tatyana Leontovichd34f4102018-04-03 17:49:24 +03001{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_GTW01 with context %}
6{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
7{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
8{% set REPOSITORY_SUITE = os_env('REPOSITORY_SUITE', 'testing') %}
Tatyana Leontovichd34f4102018-04-03 17:49:24 +03009# Install OpenStack control services
Tatyana Leontovich0eb5ca32018-07-13 22:05:17 +030010{% set DOMAIN_NAME = os_env('DOMAIN_NAME', 'virtual-offline-pike-ovs-dpdk') %}
Tatyana Leontovichbb29d1d2018-06-19 13:23:04 +030011{% import 'shared-backup-restore.yaml' as BACKUP with context %}
Tatyana Leontovich0eb5ca32018-07-13 22:05:17 +030012{% import 'shared-salt.yaml' as SHARED with context %}
13
14{% set DOCKER_LOCAL_REPO = os_env('DOCKER_LOCAL_REPO', 'deb [arch=amd64] http://mirror.mcp.mirantis.local.test/ubuntu-xenial/docker ' + REPOSITORY_SUITE + ' stable') %}
15
Tatyana Leontovichbb29d1d2018-06-19 13:23:04 +030016
Tatyana Leontovichd34f4102018-04-03 17:49:24 +030017- description: Install glance on all controllers
18 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
19 -C 'I@glance:server' state.sls glance -b 1
20 node_name: {{ HOSTNAME_CFG01 }}
21 retry: {count: 1, delay: 5}
22 skip_fail: false
23
24- description: Install keystone service (note that different fernet keys are created on different nodes)
25 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
26 -C 'I@keystone:server' state.sls keystone.server -b 1
27 node_name: {{ HOSTNAME_CFG01 }}
28 retry: {count: 2, delay: 15}
29 skip_fail: false
30
31- description: Restart apache due to PROD-10477
32 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
33 node_name: {{ HOSTNAME_CFG01 }}
34 retry: {count: 1, delay: 15}
35 skip_fail: false
36
37- description: Check apache status to PROD-10477
38 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
39 node_name: {{ HOSTNAME_CFG01 }}
40 retry: {count: 1, delay: 15}
41 skip_fail: false
42
43- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
44 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
45 -C 'I@glance:server' state.sls glusterfs.client
46 node_name: {{ HOSTNAME_CFG01 }}
47 retry: {count: 1, delay: 5}
48 skip_fail: false
49
50- description: Update fernet keys for keystone server on the mounted glusterfs volume
51 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
52 -C 'I@keystone:server' state.sls keystone.server -b 1
53 node_name: {{ HOSTNAME_CFG01 }}
54 retry: {count: 1, delay: 5}
55 skip_fail: false
56
57- description: Populate keystone services/tenants/admins
58 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
59 -C 'I@keystone:client' state.sls keystone.client
60 node_name: {{ HOSTNAME_CFG01 }}
61 retry: {count: 2, delay: 5}
62 skip_fail: false
63
64- description: Check keystone service-list
65 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
66 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
67 node_name: {{ HOSTNAME_CFG01 }}
68 retry: {count: 1, delay: 5}
69 skip_fail: false
70
71- description: Check glance image-list
72 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
73 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; glance image-list'
74 node_name: {{ HOSTNAME_CFG01 }}
75 retry: {count: 1, delay: 5}
76 skip_fail: false
77
78
79- description: Install nova on all controllers
80 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
81 -C 'I@nova:controller' state.sls nova -b 1
82 node_name: {{ HOSTNAME_CFG01 }}
83 retry: {count: 2, delay: 5}
84 skip_fail: false
85
86- description: Check nova service-list
87 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
88 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; nova --debug service-list'
89 node_name: {{ HOSTNAME_CFG01 }}
90 retry: {count: 3, delay: 5}
91 skip_fail: false
92
93
94- description: Install cinder
95 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
96 -C 'I@cinder:controller' state.sls cinder -b 1
97 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 2, delay: 5}
99 skip_fail: false
100
101- description: Check cinder list
102 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
103 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; cinder list'
104 node_name: {{ HOSTNAME_CFG01 }}
105 retry: {count: 1, delay: 5}
106 skip_fail: false
107
108
109- description: Install neutron service
110 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
111 -C 'I@neutron:server' state.sls neutron -b 1
112 node_name: {{ HOSTNAME_CFG01 }}
113 retry: {count: 1, delay: 5}
114 skip_fail: false
115
Tatyana Leontovich5fb5ea52018-07-27 19:35:36 +0300116# isntall designate
117- description: Install powerdns
118 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
119 -C 'I@powerdns:server' state.sls powerdns.server
120 node_name: {{ HOSTNAME_CFG01 }}
121 retry: {count: 1, delay: 5}
122 skip_fail: false
123
124- description: Install designate
125 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
126 -C 'I@designate:server' state.sls designate -b 1
127 node_name: {{ HOSTNAME_CFG01 }}
128 retry: {count: 5, delay: 10}
129 skip_fail: false
130
Tatyana Leontovichd34f4102018-04-03 17:49:24 +0300131- description: Install neutron on gtw node
132 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
133 -C 'I@neutron:gateway' state.sls neutron
134 node_name: {{ HOSTNAME_CFG01 }}
135 retry: {count: 1, delay: 5}
136 skip_fail: false
137
Tatyana Leontovichd34f4102018-04-03 17:49:24 +0300138- description: Check neutron agent-list
139 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
140 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; neutron agent-list'
141 node_name: {{ HOSTNAME_CFG01 }}
142 retry: {count: 1, delay: 5}
143 skip_fail: false
144
145
146- description: Install heat service
147 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
148 -C 'I@heat:server' state.sls heat -b 1
149 node_name: {{ HOSTNAME_CFG01 }}
150 retry: {count: 1, delay: 5}
151 skip_fail: false
152
153- description: Check heat service
154 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
155 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
156 node_name: {{ HOSTNAME_CFG01 }}
157 retry: {count: 5, delay: 10}
158 skip_fail: false
159
Tatyana Leontovich5fb5ea52018-07-27 19:35:36 +0300160# Install Telemetry services (mdb nodes)
161- description: Install redis service
162 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@redis:cluster:role:master' state.sls redis &&
163 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@redis:server' state.sls redis
164 node_name: {{ HOSTNAME_CFG01 }}
165 retry: {count: 1, delay: 5}
166 skip_fail: false
167
168- description: Install gnocchi server
169 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:server and *01*' state.sls gnocchi.server &&
170 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:server' state.sls gnocchi.server
171 node_name: {{ HOSTNAME_CFG01 }}
172 retry: {count: 1, delay: 5}
173 skip_fail: false
174
Dennis Dmitriev85145a62018-08-03 19:22:08 +0300175- description: Setup gnocchi client
176 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:client and *01*' state.sls gnocchi.client &&
177 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:client' state.sls gnocchi.client
178 node_name: {{ HOSTNAME_CFG01 }}
179 retry: {count: 1, delay: 5}
180 skip_fail: false
181
Tatyana Leontovich5fb5ea52018-07-27 19:35:36 +0300182- description: Install panko server
183 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@panko:server and *01*' state.sls panko &&
184 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@panko:server' state.sls panko
185 node_name: {{ HOSTNAME_CFG01 }}
186 retry: {count: 1, delay: 5}
187 skip_fail: false
188
189- description: Install ceilometer server on first node
190 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceilometer:server and *01*' state.sls ceilometer
191 node_name: {{ HOSTNAME_CFG01 }}
192 retry: {count: 2, delay: 5}
193 skip_fail: false
194
195- description: Install ceilometer server on other nodes
196 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceilometer:server' state.sls ceilometer
197 node_name: {{ HOSTNAME_CFG01 }}
198 retry: {count: 2, delay: 5}
199 skip_fail: false
200
201- description: Install aodh server
202 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@aodh:server and *01*' state.sls aodh &&
203 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@aodh:server' state.sls aodh
204 node_name: {{ HOSTNAME_CFG01 }}
205 retry: {count: 1, delay: 5}
206 skip_fail: false
Tatyana Leontovichd34f4102018-04-03 17:49:24 +0300207
208- description: Deploy horizon dashboard
209 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
210 -C 'I@horizon:server' state.sls horizon
211 node_name: {{ HOSTNAME_CFG01 }}
212 retry: {count: 1, delay: 5}
213 skip_fail: true
214
215- description: Deploy nginx proxy
216 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
217 -C 'I@nginx:server' state.sls nginx
218 node_name: {{ HOSTNAME_CFG01 }}
219 retry: {count: 1, delay: 5}
220 skip_fail: true
221
222
223# Install compute node
224
225- description: Apply formulas for compute node
226 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
227 node_name: {{ HOSTNAME_CFG01 }}
228 retry: {count: 1, delay: 5}
229 skip_fail: true
230
231- description: Re-apply(as in doc) formulas for compute node
232 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
233 node_name: {{ HOSTNAME_CFG01 }}
234 retry: {count: 1, delay: 5}
235 skip_fail: false
236
237- description: Check IP on computes
238 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
239 'ip a'
240 node_name: {{ HOSTNAME_CFG01 }}
241 retry: {count: 10, delay: 30}
242 skip_fail: false
243
Tatyana Leontovichd34f4102018-04-03 17:49:24 +0300244 # Upload cirros image
Tatyana Leontovichd34f4102018-04-03 17:49:24 +0300245- description: Upload cirros image on ctl01
246 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
247 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
248 node_name: {{ HOSTNAME_CFG01 }}
249 retry: {count: 2, delay: 30}
250 skip_fail: false
251
252- description: Create net04_external
253 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
254 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
255 node_name: {{ HOSTNAME_CFG01 }}
256 retry: {count: 1, delay: 30}
257 skip_fail: false
258
259- description: Create subnet_external
260 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
261 '. /root/keystonercv3; neutron subnet-create net04_ext {{ IPV4_NET_EXTERNAL_PREFIX }}.0/24 --name net04_ext__subnet --disable-dhcp --allocation-pool start={{ IPV4_NET_EXTERNAL_PREFIX }}.150,end={{ IPV4_NET_EXTERNAL_PREFIX }}.180 --gateway {{ IPV4_NET_EXTERNAL_PREFIX }}.1'
262 node_name: {{ HOSTNAME_CFG01 }}
263 retry: {count: 1, delay: 30}
264 skip_fail: false
265
266- description: Create net04
267 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
268 '. /root/keystonercv3; neutron net-create net04'
269 node_name: {{ HOSTNAME_CFG01 }}
270 retry: {count: 1, delay: 30}
271 skip_fail: false
272
273- description: Create subnet_net04
274 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
275 '. /root/keystonercv3; neutron subnet-create net04 {{ IPV4_NET_TENANT_PREFIX }}.0/24 --name net04__subnet --allocation-pool start={{ IPV4_NET_TENANT_PREFIX }}.120,end={{ IPV4_NET_TENANT_PREFIX }}.240'
276 node_name: {{ HOSTNAME_CFG01 }}
277 retry: {count: 1, delay: 30}
278 skip_fail: false
279
280- description: Create router
281 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
282 '. /root/keystonercv3; neutron router-create net04_router01'
283 node_name: {{ HOSTNAME_CFG01 }}
284 retry: {count: 1, delay: 30}
285 skip_fail: false
286
287- description: Set geteway
288 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
289 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
290 node_name: {{ HOSTNAME_CFG01 }}
291 retry: {count: 1, delay: 30}
292 skip_fail: false
293
294- description: Add interface
295 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
296 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
297 node_name: {{ HOSTNAME_CFG01 }}
298 retry: {count: 1, delay: 30}
299 skip_fail: false
300
301- description: sync time
302 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
303 'service ntp stop; ntpd -gq; service ntp start'
304 node_name: {{ HOSTNAME_CFG01 }}
305 retry: {count: 1, delay: 30}
306 skip_fail: false
307
308- description: Enable local docker repo
309 cmd: |
310 set -e;
311 echo "{{ DOCKER_LOCAL_REPO }}" > /etc/apt/sources.list.d/mcp_docker.list;
312 apt-get clean; apt-get update;
313 node_name: {{ HOSTNAME_GTW01 }}
314 retry: {count: 1, delay: 30}
315 skip_fail: false
316
317- description: Install docker-ce on gtw
318 cmd: salt-call cmd.run 'apt-get install docker-ce -y'
319 node_name: {{ HOSTNAME_GTW01 }}
320 retry: {count: 1, delay: 30}
321 skip_fail: false
322
323- description: Enable forward policy on gtw
324 cmd: |
325 set -e;
326 iptables --policy FORWARD ACCEPT;
327 node_name: {{ HOSTNAME_GTW01 }}
328 retry: {count: 1, delay: 30}
329 skip_fail: false
330
331- description: create rc file on cfg
332 cmd: scp ctl01:/root/keystonercv3 /root
333 node_name: {{ HOSTNAME_CFG01 }}
334 retry: {count: 1, delay: 30}
335 skip_fail: false
336
337- description: Copy rc file
338 cmd: scp /root/keystonercv3 gtw01:/root
339 node_name: {{ HOSTNAME_CFG01 }}
340 retry: {count: 1, delay: 30}
341 skip_fail: false
Tatyana Leontovichbb29d1d2018-06-19 13:23:04 +0300342
Tatyana Leontoviche1d16192018-07-18 15:07:51 +0300343{{ BACKUP.MACRO_WR_NGINX_MASTER() }}
Tatyana Leontovichbb29d1d2018-06-19 13:23:04 +0300344{{ BACKUP.MACRO_BACKUP_BACKUPNINJA() }}
345{{ BACKUP.MACRO_BACKUP_XTRABACKUP() }}