blob: b3215d3dcf25c1a58d6438978134b89db67f60d4 [file] [log] [blame]
ibumarskovb5210062018-08-22 16:18:15 +04001{# Collection of common macroses shared across openstack services #}
2
Dennis Dmitriev4034db02018-08-26 21:50:13 +03003{%- macro MACRO_INSTALL_KEYSTONE(USE_ORCHESTRATE=true) %}
4 {%- if USE_ORCHESTRATE %}
5- description: |
Oleksii Butenkoe0fc5f22018-09-25 14:29:42 +03006 Execute salt orchestration state to configure all needed
ibumarskov330bc122018-08-23 13:02:04 +04007 prerequisites like creating SSH public key ant etc.
Dennis Dmitriev4034db02018-08-26 21:50:13 +03008 Workaround for PROD-22488, use for PROD-22535.
ibumarskov330bc122018-08-23 13:02:04 +04009 cmd: salt-run state.orchestrate keystone.orchestrate.deploy
10 node_name: {{ HOSTNAME_CFG01 }}
11 retry: {count: 1, delay: 5}
12 skip_fail: false
Dennis Dmitriev4034db02018-08-26 21:50:13 +030013 {%- endif %}
ibumarskov330bc122018-08-23 13:02:04 +040014
ibumarskovb5210062018-08-22 16:18:15 +040015- description: Install keystone service on primary node
16 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
17 -C 'I@keystone:server and *01*' state.sls keystone.server
18 node_name: {{ HOSTNAME_CFG01 }}
19 retry: {count: 2, delay: 15}
20 skip_fail: false
21
22- description: Install keystone service on other nodes
23 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
24 -C 'I@keystone:server' state.sls keystone.server
25 node_name: {{ HOSTNAME_CFG01 }}
26 retry: {count: 2, delay: 15}
27 skip_fail: false
28
29- description: Restart apache due to PROD-10477
30 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*'
ibumarskov1b85e892018-08-30 11:54:47 +040031 cmd.run "service apache2 restart"
ibumarskovb5210062018-08-22 16:18:15 +040032 node_name: {{ HOSTNAME_CFG01 }}
33 retry: {count: 1, delay: 15}
34 skip_fail: false
35
36- description: Check apache status to PROD-10477
37 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*'
ibumarskov1b85e892018-08-30 11:54:47 +040038 cmd.run "service apache2 status"
ibumarskovb5210062018-08-22 16:18:15 +040039 node_name: {{ HOSTNAME_CFG01 }}
40 retry: {count: 1, delay: 15}
41 skip_fail: false
42
Dennis Dmitriev4034db02018-08-26 21:50:13 +030043- description: Mount glusterfs.client volumes (resuires created 'keystone' system user)
44 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
45 -C 'I@keystone:server' state.sls glusterfs.client -b 1
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
ibumarskovb5210062018-08-22 16:18:15 +040057- 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
Oleksii Butenko8b49a762018-09-18 11:46:35 +030066 -C "I@keystone:server" cmd.run ". /root/keystonercv3;
67 openstack service list"
ibumarskovb5210062018-08-22 16:18:15 +040068 node_name: {{ HOSTNAME_CFG01 }}
69 retry: {count: 1, delay: 5}
70 skip_fail: false
71{%- endmacro %}
72
73{%- macro MACRO_INSTALL_GLANCE() %}
74- description: Install glance service on primary node
75 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
76 -C 'I@glance:server and *01*' state.sls glance.server
77 node_name: {{ HOSTNAME_CFG01 }}
78 retry: {count: 1, delay: 5}
79 skip_fail: false
80
81- description: Install glance service on other nodes
82 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
83 -C 'I@glance:server' state.sls glance.server
84 node_name: {{ HOSTNAME_CFG01 }}
85 retry: {count: 1, delay: 5}
86 skip_fail: false
87
Dennis Dmitriev4034db02018-08-26 21:50:13 +030088- description: Mount glusterfs.client volumes (resuires created 'glusterfs' system user)
ibumarskovb5210062018-08-22 16:18:15 +040089 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Dennis Dmitriev4034db02018-08-26 21:50:13 +030090 -C 'I@glance:server' state.sls glusterfs.client -b 1
ibumarskovb5210062018-08-22 16:18:15 +040091 node_name: {{ HOSTNAME_CFG01 }}
92 retry: {count: 1, delay: 5}
93 skip_fail: false
94
95- description: Check glance image-list
96 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +030097 -C "I@keystone:server" cmd.run ". /root/keystonercv3;
98 openstack image list"
ibumarskovb5210062018-08-22 16:18:15 +040099 node_name: {{ HOSTNAME_CFG01 }}
100 retry: {count: 1, delay: 5}
101 skip_fail: false
102{%- endmacro %}
103
104{%- macro MACRO_INSTALL_NOVA() %}
Tatyana Leontovich114953d2018-11-01 15:45:26 +0200105
106- description: Deploy nginx proxy
107 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
108 -C 'I@nginx:server' state.sls nginx
109 node_name: {{ HOSTNAME_CFG01 }}
110 retry: {count: 1, delay: 5}
111 skip_fail: true
112
ibumarskovb5210062018-08-22 16:18:15 +0400113- description: Install nova service on primary node
114 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
115 -C "I@nova:controller and *01*" state.sls nova.controller
116 node_name: {{ HOSTNAME_CFG01 }}
117 retry: {count: 1, delay: 5}
118 skip_fail: false
119
120- description: Install nova service on other nodes
121 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
122 -C "I@nova:controller" state.sls nova.controller
123 node_name: {{ HOSTNAME_CFG01 }}
124 retry: {count: 1, delay: 5}
125 skip_fail: false
126
127- description: Check nova service-list
128 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +0300129 -C "I@keystone:server" cmd.run ". /root/keystonercv3;
130 openstack compute service list"
ibumarskovb5210062018-08-22 16:18:15 +0400131 node_name: {{ HOSTNAME_CFG01 }}
132 retry: {count: 1, delay: 5}
133 skip_fail: false
134
135- description: Check nova list
136 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +0300137 -C "I@keystone:server" cmd.run ". /root/keystonercv3;
138 openstack server list"
ibumarskovb5210062018-08-22 16:18:15 +0400139 node_name: {{ HOSTNAME_CFG01 }}
140 retry: {count: 1, delay: 5}
141 skip_fail: false
Tatyana Leontovichb4c519d2018-10-31 13:44:45 +0200142
143- description: Create nova resources
Tatyana Leontovicha5b8d602018-10-31 16:34:31 +0200144 cmd: |
Tatyana Leontovichd3b17e72018-11-01 13:34:54 +0200145 if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@nova:client' match.pillar 'nova:client' ; then
Tatyana Leontovicha5b8d602018-10-31 16:34:31 +0200146 salt --hard-crash --state-output=mixed --state-verbose=False -C "I@nova:client" state.sls nova.client
147 fi
Tatyana Leontovichb4c519d2018-10-31 13:44:45 +0200148 node_name: {{ HOSTNAME_CFG01 }}
149 retry: {count: 1, delay: 5}
150 skip_fail: false
ibumarskovb5210062018-08-22 16:18:15 +0400151{%- endmacro %}
152
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300153{%- macro MACRO_INSTALL_CINDER(INSTALL_VOLUME=false) %}
ibumarskovb5210062018-08-22 16:18:15 +0400154- description: Install cinder on primary node
155 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
156 -C "I@cinder:controller and *01*" state.sls cinder
157 node_name: {{ HOSTNAME_CFG01 }}
158 retry: {count: 1, delay: 5}
159 skip_fail: false
160
161- description: Install cinder on other nodes
162 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
163 -C "I@cinder:controller" state.sls cinder
164 node_name: {{ HOSTNAME_CFG01 }}
165 retry: {count: 1, delay: 5}
166 skip_fail: false
167
168- description: Check cinder list
169 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +0300170 -C "I@keystone:server" cmd.run ". /root/keystonercv3;
171 openstack volume list"
ibumarskovb5210062018-08-22 16:18:15 +0400172 node_name: {{ HOSTNAME_CFG01 }}
173 retry: {count: 1, delay: 5}
174 skip_fail: false
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300175
176 {%- if INSTALL_VOLUME %}
Oleksii Butenkobf9ad0a2018-11-06 10:36:36 +0200177- description: Install cinder volume, PROD-24485 set retry 2
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300178 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
179 -C 'I@cinder:volume' state.sls cinder
180 node_name: {{ HOSTNAME_CFG01 }}
Oleksii Butenkobf9ad0a2018-11-06 10:36:36 +0200181 retry: {count: 2, delay: 5}
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300182 skip_fail: false
183 {%- endif %}
184
ibumarskovb5210062018-08-22 16:18:15 +0400185{%- endmacro %}
186
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300187{%- macro MACRO_INSTALL_NEUTRON(INSTALL_GATEWAY=true) %}
ibumarskovb5210062018-08-22 16:18:15 +0400188- description: Install neutron service on primary node
189 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
190 -C "I@neutron:server and *01*" state.sls neutron.server
191 node_name: {{ HOSTNAME_CFG01 }}
192 retry: {count: 1, delay: 5}
193 skip_fail: false
194
195- description: Install neutron service on other nodes
196 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
197 -C "I@neutron:server" state.sls neutron.server
198 node_name: {{ HOSTNAME_CFG01 }}
199 retry: {count: 1, delay: 5}
200 skip_fail: false
201
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300202 {%- if INSTALL_GATEWAY %}
ibumarskovb5210062018-08-22 16:18:15 +0400203- description: Install neutron on gtw node
204 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
205 -C 'I@neutron:gateway' state.sls neutron
206 node_name: {{ HOSTNAME_CFG01 }}
207 retry: {count: 1, delay: 5}
208 skip_fail: false
209
210- description: Check neutron agent-list
211 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko16f86912018-09-20 11:47:00 +0300212 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; neutron agent-list'
ibumarskovb5210062018-08-22 16:18:15 +0400213 node_name: {{ HOSTNAME_CFG01 }}
214 retry: {count: 1, delay: 5}
215 skip_fail: false
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300216 {%- endif %}
217
ibumarskovb5210062018-08-22 16:18:15 +0400218{%- endmacro %}
219
220{%- macro MACRO_INSTALL_HEAT() %}
221- description: Install heat service on primary node
222 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
223 -C "I@heat:server and *01*" state.sls heat.server
224 node_name: {{ HOSTNAME_CFG01 }}
225 retry: {count: 1, delay: 5}
226 skip_fail: false
227
228- description: Install heat service on other nodes
229 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
230 -C "I@heat:server" state.sls heat.server
231 node_name: {{ HOSTNAME_CFG01 }}
232 retry: {count: 1, delay: 5}
233 skip_fail: false
234
235- description: Check heat service
236 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +0300237 -C 'I@keystone:server' cmd.run '. /root/keystonercv3;
238 openstack orchestration resource type list'
ibumarskovb5210062018-08-22 16:18:15 +0400239 node_name: {{ HOSTNAME_CFG01 }}
240 retry: {count: 5, delay: 10}
241 skip_fail: false
242{%- endmacro %}
243
244{%- macro MACRO_INSTALL_HORIZON() %}
245- description: Deploy horizon dashboard
246 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
247 -C 'I@horizon:server' state.sls horizon
248 node_name: {{ HOSTNAME_CFG01 }}
249 retry: {count: 1, delay: 5}
250 skip_fail: true
ibumarskovb5210062018-08-22 16:18:15 +0400251{%- endmacro %}
252
Oleksii Butenko81d8a7f2018-09-26 16:09:27 +0300253{%- macro MACRO_INSTALL_DESIGNATE(INSTALL_POWERDNS=false, INSTALL_BIND=false) %}
Oleksii Butenkoe0fc5f22018-09-25 14:29:42 +0300254 {%- if INSTALL_POWERDNS %}
255- description: Install powerdns
256 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
257 -C 'I@powerdns:server' state.sls powerdns.server
258 node_name: {{ HOSTNAME_CFG01 }}
259 retry: {count: 1, delay: 5}
260 skip_fail: false
261 {%- endif %}
262
Oleksii Butenko81d8a7f2018-09-26 16:09:27 +0300263 {%- if INSTALL_BIND %}
264- description: Install bind
265 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
266 -C 'I@bind:server' state.sls bind
267 node_name: {{ HOSTNAME_CFG01 }}
268 retry: {count: 1, delay: 5}
269 skip_fail: false
270 {%- endif %}
271
ibumarskovb5210062018-08-22 16:18:15 +0400272- description: Install designate on primary node
273 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
274 -C "I@designate:server and *01*" state.sls designate.server
275 node_name: {{ HOSTNAME_CFG01 }}
276 retry: {count: 5, delay: 10}
277 skip_fail: false
278
279- description: Install designate on other nodes
280 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
281 -C "I@designate:server" state.sls designate
282 node_name: {{ HOSTNAME_CFG01 }}
283 retry: {count: 5, delay: 10}
284 skip_fail: false
285{%- endmacro %}
286
ibumarskovb5210062018-08-22 16:18:15 +0400287{%- macro MACRO_INSTALL_BARBICAN() %}
obutenkof009ed42018-11-12 14:50:51 +0200288
289- description: Install barbican server
290 cmd: |
291 salt -C 'I@barbican:server:role:master' state.sls barbican.server;
292 salt -C 'I@barbican:server' state.sls dogtag.server;
293 node_name: {{ HOSTNAME_CFG01 }}
294 retry: {count: 1, delay: 5}
295 skip_fail: false
296
297- description: Install barbican client
298 cmd: salt -C 'I@barbican:server:role:master' state.sls barbican.client
299 node_name: {{ HOSTNAME_CFG01 }}
300 retry: {count: 1, delay: 5}
301 skip_fail: false
302
303{%- endmacro %}
304
305{%- macro MACRO_INSTALL_DOGTAG() %}
306
307- description: Install dogtag server
308 cmd: |
309 salt -C 'I@dogtag:server:role:master' state.sls dogtag.server;
310 salt -C 'I@dogtag:server' state.sls dogtag.server;
311 node_name: {{ HOSTNAME_CFG01 }}
312 retry: {count: 1, delay: 5}
313 skip_fail: false
314
ibumarskovb5210062018-08-22 16:18:15 +0400315{%- endmacro %}
316
317{%- macro MACRO_INSTALL_IRONIC() %}
318# TO DO
319{%- endmacro %}
320
321{%- macro MACRO_INSTALL_MANILA() %}
Oleksii Butenkof57d1ff2018-09-28 17:59:45 +0300322- description: Install manila-api on first node
323 cmd: |
324 salt -C 'I@manila:api and *01*' state.sls manila.api;
325 node_name: {{ HOSTNAME_CFG01 }}
326 retry: {count: 1, delay: 5}
327 skip_fail: false
328
Oleksii Butenkof57d1ff2018-09-28 17:59:45 +0300329- description: Install manila-scheduler
330 cmd: |
331 salt -C 'I@manila:scheduler' state.sls manila.scheduler;
332 node_name: {{ HOSTNAME_CFG01 }}
333 retry: {count: 1, delay: 5}
334 skip_fail: false
335
336- description: Install manila-share
337 cmd: |
338 salt -C 'I@manila:share' state.sls manila.share;
339 node_name: {{ HOSTNAME_CFG01 }}
340 retry: {count: 1, delay: 5}
341 skip_fail: false
342
Oleksii Butenkof57d1ff2018-09-28 17:59:45 +0300343- description: Check manila-services
344 cmd: |
345 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila service-list'
346 node_name: {{ HOSTNAME_CFG01 }}
347 retry: {count: 3, delay: 15}
348 skip_fail: false
349
350- description: Create manila type
351 cmd: |
Oleksii Butenko40772422018-10-01 16:52:49 +0300352 salt -C "I@manila:client" state.sls manila.client
Oleksii Butenkof57d1ff2018-09-28 17:59:45 +0300353 node_name: {{ HOSTNAME_CFG01 }}
354 retry: {count: 1, delay: 5}
355 skip_fail: false
356
357- description: Create CIFS and NFS share and check it status
358 cmd: |
359 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create CIFS 1 --share-type=default';
360 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create NFS 1 --share-type=default';
361 sleep 5;
362 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila list';
363 node_name: {{ HOSTNAME_CFG01 }}
364 retry: {count: 1, delay: 5}
365 skip_fail: false
ibumarskovb5210062018-08-22 16:18:15 +0400366{%- endmacro %}
367
368{%- macro MACRO_INSTALL_OCTAVIA_API() %}
Tatyana Leontovich56a72412018-11-05 14:11:41 +0200369
370- description: Execute glance client to upload octavia image
371 cmd: salt -C 'I@glance:client' state.sls glance.client
372 node_name: {{ HOSTNAME_CFG01 }}
373 retry: {count: 1, delay: 5}
374 skip_fail: false
375
Tatyana Leontovichda703b92018-11-06 22:31:40 +0200376- description: Execute neutron client to create octavia resources
377 cmd: salt -C 'I@neutron:client' state.sls neutron.client
378 node_name: {{ HOSTNAME_CFG01 }}
379 retry: {count: 1, delay: 5}
380 skip_fail: false
381
Tatyana Leontovich931892e2018-10-18 14:27:12 +0300382- description: Install octavia api service on primary node
383 cmd: salt -C 'I@octavia:api:role:primary' state.sls octavia.api
384 node_name: {{ HOSTNAME_CFG01 }}
385 retry: {count: 1, delay: 5}
386 skip_fail: false
387
388- description: Install octavia api service
389 cmd: salt -C 'I@octavia:api' state.sls octavia.api
390 node_name: {{ HOSTNAME_CFG01 }}
391 retry: {count: 1, delay: 5}
392 skip_fail: false
393
394{%- endmacro %}
395
396{%- macro MACRO_INSTALL_OCTAVIA_MANAGER() %}
397- description: Update mine
398 cmd: salt -C 'I@neutron:client' mine.update && sleep 60
399 node_name: {{ HOSTNAME_CFG01 }}
400 retry: {count: 1, delay: 5}
401 skip_fail: false
402
403- description: Install octavia manager
404 cmd: salt -C 'I@octavia:manager' state.sls octavia.manager
405 node_name: {{ HOSTNAME_CFG01 }}
406 retry: {count: 1, delay: 5}
407 skip_fail: false
408
409- description: Execute octavia ca
410 cmd: salt -C 'I@octavia:manager' state.sls salt.minion.ca
411 node_name: {{ HOSTNAME_CFG01 }}
412 retry: {count: 1, delay: 5}
413 skip_fail: false
414
415- description: Execute octavia cert
416 cmd: salt -C 'I@octavia:manager' state.sls salt.minion.cert
417 node_name: {{ HOSTNAME_CFG01 }}
418 retry: {count: 1, delay: 5}
419 skip_fail: false
420
421- description: Execute octavia client
422 cmd: salt -C 'I@octavia:client' state.sls octavia.client
423 node_name: {{ HOSTNAME_CFG01 }}
424 retry: {count: 1, delay: 5}
425 skip_fail: false
426
ibumarskovb5210062018-08-22 16:18:15 +0400427{%- endmacro %}
428
Oleksii Butenkode0c5ee2018-09-24 15:29:45 +0300429{%- macro MACRO_INSTALL_COMPUTE(CELL_MAPPING=false) %}
Oleksii Butenko20947f22018-08-29 15:48:21 +0300430# Install compute node
431- description: Apply formulas for compute node
432 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
433 node_name: {{ HOSTNAME_CFG01 }}
434 retry: {count: 1, delay: 5}
435 skip_fail: true
436
437- description: Re-apply(as in doc) formulas for compute node
438 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
439 node_name: {{ HOSTNAME_CFG01 }}
440 retry: {count: 1, delay: 5}
441 skip_fail: false
442
443- description: Check IP on computes
444 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
445 'ip a'
446 node_name: {{ HOSTNAME_CFG01 }}
447 retry: {count: 10, delay: 30}
448 skip_fail: false
Oleksii Butenkode0c5ee2018-09-24 15:29:45 +0300449
450 {%- if CELL_MAPPING %}
451- description: Re-run nova for map cell mapping
452 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
453 -C "I@nova:controller and *01*" state.sls nova.controller
454 node_name: {{ HOSTNAME_CFG01 }}
455 retry: {count: 1, delay: 5}
456 skip_fail: false
457 {%- endif %}
Oleksii Butenko48f9a7b2018-10-11 14:04:45 +0300458{%- endmacro %}
Oleksii Butenkode0c5ee2018-09-24 15:29:45 +0300459
Oleksii Butenko48f9a7b2018-10-11 14:04:45 +0300460{%- macro MACRO_INSTALL_REDIS() %}
461- description: Install redis service
462 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@redis:cluster:role:master' state.sls redis &&
463 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@redis:server' state.sls redis
464 node_name: {{ HOSTNAME_CFG01 }}
465 retry: {count: 1, delay: 5}
466 skip_fail: false
467{%- endmacro %}
468
469{%- macro MACRO_INSTALL_GNOCCHI() %}
470- description: Install gnocchi server
471 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:server and *01*' state.sls gnocchi.server &&
472 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:server' state.sls gnocchi.server
473 node_name: {{ HOSTNAME_CFG01 }}
474 retry: {count: 1, delay: 5}
475 skip_fail: false
476
477- description: Setup gnocchi client
478 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:client and *01*' state.sls gnocchi.client &&
479 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:client' state.sls gnocchi.client
480 node_name: {{ HOSTNAME_CFG01 }}
481 retry: {count: 1, delay: 5}
482 skip_fail: false
483{%- endmacro %}
484
485{%- macro MACRO_INSTALL_PANKO() %}
486- description: Install panko server
487 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@panko:server and *01*' state.sls panko &&
488 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@panko:server' state.sls panko
489 node_name: {{ HOSTNAME_CFG01 }}
490 retry: {count: 1, delay: 5}
491 skip_fail: false
492{%- endmacro %}
493
494{%- macro MACRO_INSTALL_CEILOMETER() %}
495- description: Install ceilometer server on first node
496 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceilometer:server and *01*' state.sls ceilometer
497 node_name: {{ HOSTNAME_CFG01 }}
498 retry: {count: 2, delay: 5}
499 skip_fail: false
500
501- description: Install ceilometer server on other nodes
502 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceilometer:server' state.sls ceilometer
503 node_name: {{ HOSTNAME_CFG01 }}
504 retry: {count: 2, delay: 5}
505 skip_fail: false
506{%- endmacro %}
507
508{%- macro MACRO_INSTALL_AODH() %}
509- description: Install aodh server
510 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@aodh:server and *01*' state.sls aodh &&
511 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@aodh:server' state.sls aodh
512 node_name: {{ HOSTNAME_CFG01 }}
513 retry: {count: 1, delay: 5}
514 skip_fail: false
Oleksii Butenko20947f22018-08-29 15:48:21 +0300515{%- endmacro %}
Oleksii Butenkoffc09222018-09-21 12:37:16 +0300516
517{%- macro OVERRIDE_POLICY() %}
518- description: Upload policy override
519 upload:
520 local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/
521 local_filename: overrides-policy.yml
522 remote_path: /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/
523 node_name: {{ HOSTNAME_CFG01 }}
524
525- description: Create custom cluster control class
526 cmd: echo -e "classes:\n- cluster.{{ LAB_CONFIG_NAME }}.openstack.control_orig\n$(cat /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml)" > /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml
527 node_name: {{ HOSTNAME_CFG01 }}
528
529- description: Rename control classes
530 cmd: mv /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control_orig.yml &&
531 ln -s /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml &&
532 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all &&
533 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar
534 node_name: {{ HOSTNAME_CFG01 }}
Oleksii Butenkoc07e4062018-10-29 12:04:42 +0200535{%- endmacro %}