blob: 4a5be47806c63d2585ac474648f7da1ecc951e72 [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
43- description: Populate keystone services/tenants/admins
44 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
45 -C 'I@keystone:client' state.sls keystone.client
46 node_name: {{ HOSTNAME_CFG01 }}
47 retry: {count: 2, delay: 5}
48 skip_fail: false
49
50- description: Check keystone service-list
51 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +030052 -C "I@keystone:server" cmd.run ". /root/keystonercv3;
53 openstack service list"
ibumarskovb5210062018-08-22 16:18:15 +040054 node_name: {{ HOSTNAME_CFG01 }}
55 retry: {count: 1, delay: 5}
56 skip_fail: false
57{%- endmacro %}
58
59{%- macro MACRO_INSTALL_GLANCE() %}
60- description: Install glance service on primary node
61 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
62 -C 'I@glance:server and *01*' state.sls glance.server
63 node_name: {{ HOSTNAME_CFG01 }}
64 retry: {count: 1, delay: 5}
65 skip_fail: false
66
67- description: Install glance service on other nodes
68 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
69 -C 'I@glance:server' state.sls glance.server
70 node_name: {{ HOSTNAME_CFG01 }}
71 retry: {count: 1, delay: 5}
72 skip_fail: false
73
ibumarskovb5210062018-08-22 16:18:15 +040074- description: Check glance image-list
75 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +030076 -C "I@keystone:server" cmd.run ". /root/keystonercv3;
77 openstack image list"
ibumarskovb5210062018-08-22 16:18:15 +040078 node_name: {{ HOSTNAME_CFG01 }}
Dennis Dmitrievb1cd3462018-12-11 18:56:41 +020079 retry: {count: 5, delay: 15}
ibumarskovb5210062018-08-22 16:18:15 +040080 skip_fail: false
81{%- endmacro %}
82
83{%- macro MACRO_INSTALL_NOVA() %}
Tatyana Leontovich114953d2018-11-01 15:45:26 +020084
ibumarskovb5210062018-08-22 16:18:15 +040085- description: Install nova service on primary node
86 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
87 -C "I@nova:controller and *01*" state.sls nova.controller
88 node_name: {{ HOSTNAME_CFG01 }}
89 retry: {count: 1, delay: 5}
90 skip_fail: false
91
92- description: Install nova service on other nodes
93 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
94 -C "I@nova:controller" state.sls nova.controller
95 node_name: {{ HOSTNAME_CFG01 }}
96 retry: {count: 1, delay: 5}
97 skip_fail: false
98
99- description: Check nova service-list
100 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +0300101 -C "I@keystone:server" cmd.run ". /root/keystonercv3;
102 openstack compute service list"
ibumarskovb5210062018-08-22 16:18:15 +0400103 node_name: {{ HOSTNAME_CFG01 }}
104 retry: {count: 1, delay: 5}
105 skip_fail: false
106
107- description: Check nova list
108 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +0300109 -C "I@keystone:server" cmd.run ". /root/keystonercv3;
110 openstack server list"
ibumarskovb5210062018-08-22 16:18:15 +0400111 node_name: {{ HOSTNAME_CFG01 }}
112 retry: {count: 1, delay: 5}
113 skip_fail: false
Tatyana Leontovichb4c519d2018-10-31 13:44:45 +0200114
115- description: Create nova resources
Tatyana Leontovicha5b8d602018-10-31 16:34:31 +0200116 cmd: |
Tatyana Leontovichd3b17e72018-11-01 13:34:54 +0200117 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 +0200118 salt --hard-crash --state-output=mixed --state-verbose=False -C "I@nova:client" state.sls nova.client
119 fi
Tatyana Leontovichb4c519d2018-10-31 13:44:45 +0200120 node_name: {{ HOSTNAME_CFG01 }}
121 retry: {count: 1, delay: 5}
122 skip_fail: false
ibumarskovb5210062018-08-22 16:18:15 +0400123{%- endmacro %}
124
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300125{%- macro MACRO_INSTALL_CINDER(INSTALL_VOLUME=false) %}
ibumarskovb5210062018-08-22 16:18:15 +0400126- description: Install cinder on primary node
127 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
128 -C "I@cinder:controller and *01*" state.sls cinder
129 node_name: {{ HOSTNAME_CFG01 }}
130 retry: {count: 1, delay: 5}
131 skip_fail: false
132
133- description: Install cinder on other nodes
134 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
135 -C "I@cinder:controller" state.sls cinder
136 node_name: {{ HOSTNAME_CFG01 }}
137 retry: {count: 1, delay: 5}
138 skip_fail: false
139
140- description: Check cinder list
141 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +0300142 -C "I@keystone:server" cmd.run ". /root/keystonercv3;
143 openstack volume list"
ibumarskovb5210062018-08-22 16:18:15 +0400144 node_name: {{ HOSTNAME_CFG01 }}
145 retry: {count: 1, delay: 5}
146 skip_fail: false
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300147
148 {%- if INSTALL_VOLUME %}
Oleksii Butenkobf9ad0a2018-11-06 10:36:36 +0200149- description: Install cinder volume, PROD-24485 set retry 2
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300150 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
151 -C 'I@cinder:volume' state.sls cinder
152 node_name: {{ HOSTNAME_CFG01 }}
Oleksii Butenkobf9ad0a2018-11-06 10:36:36 +0200153 retry: {count: 2, delay: 5}
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300154 skip_fail: false
155 {%- endif %}
156
ibumarskovb5210062018-08-22 16:18:15 +0400157{%- endmacro %}
158
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300159{%- macro MACRO_INSTALL_NEUTRON(INSTALL_GATEWAY=true) %}
ibumarskovb5210062018-08-22 16:18:15 +0400160- description: Install neutron service on primary node
161 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
162 -C "I@neutron:server and *01*" state.sls neutron.server
163 node_name: {{ HOSTNAME_CFG01 }}
164 retry: {count: 1, delay: 5}
165 skip_fail: false
166
167- description: Install neutron service on other nodes
168 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
169 -C "I@neutron:server" state.sls neutron.server
170 node_name: {{ HOSTNAME_CFG01 }}
171 retry: {count: 1, delay: 5}
172 skip_fail: false
173
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300174 {%- if INSTALL_GATEWAY %}
ibumarskovb5210062018-08-22 16:18:15 +0400175- description: Install neutron on gtw node
176 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
177 -C 'I@neutron:gateway' state.sls neutron
178 node_name: {{ HOSTNAME_CFG01 }}
179 retry: {count: 1, delay: 5}
180 skip_fail: false
181
182- description: Check neutron agent-list
183 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko16f86912018-09-20 11:47:00 +0300184 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; neutron agent-list'
ibumarskovb5210062018-08-22 16:18:15 +0400185 node_name: {{ HOSTNAME_CFG01 }}
186 retry: {count: 1, delay: 5}
187 skip_fail: false
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300188 {%- endif %}
189
ibumarskovb5210062018-08-22 16:18:15 +0400190{%- endmacro %}
191
192{%- macro MACRO_INSTALL_HEAT() %}
193- description: Install heat service on primary node
194 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
195 -C "I@heat:server and *01*" state.sls heat.server
196 node_name: {{ HOSTNAME_CFG01 }}
197 retry: {count: 1, delay: 5}
198 skip_fail: false
199
200- description: Install heat service on other nodes
201 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
202 -C "I@heat:server" state.sls heat.server
203 node_name: {{ HOSTNAME_CFG01 }}
204 retry: {count: 1, delay: 5}
205 skip_fail: false
206
207- description: Check heat service
208 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +0300209 -C 'I@keystone:server' cmd.run '. /root/keystonercv3;
210 openstack orchestration resource type list'
ibumarskovb5210062018-08-22 16:18:15 +0400211 node_name: {{ HOSTNAME_CFG01 }}
212 retry: {count: 5, delay: 10}
213 skip_fail: false
214{%- endmacro %}
215
216{%- macro MACRO_INSTALL_HORIZON() %}
217- description: Deploy horizon dashboard
218 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
219 -C 'I@horizon:server' state.sls horizon
220 node_name: {{ HOSTNAME_CFG01 }}
221 retry: {count: 1, delay: 5}
222 skip_fail: true
ibumarskovb5210062018-08-22 16:18:15 +0400223{%- endmacro %}
224
Oleksii Butenko81d8a7f2018-09-26 16:09:27 +0300225{%- macro MACRO_INSTALL_DESIGNATE(INSTALL_POWERDNS=false, INSTALL_BIND=false) %}
Oleksii Butenkoe0fc5f22018-09-25 14:29:42 +0300226 {%- if INSTALL_POWERDNS %}
227- description: Install powerdns
228 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
229 -C 'I@powerdns:server' state.sls powerdns.server
230 node_name: {{ HOSTNAME_CFG01 }}
231 retry: {count: 1, delay: 5}
232 skip_fail: false
233 {%- endif %}
234
Oleksii Butenko81d8a7f2018-09-26 16:09:27 +0300235 {%- if INSTALL_BIND %}
236- description: Install bind
237 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
238 -C 'I@bind:server' state.sls bind
239 node_name: {{ HOSTNAME_CFG01 }}
240 retry: {count: 1, delay: 5}
241 skip_fail: false
242 {%- endif %}
243
ibumarskovb5210062018-08-22 16:18:15 +0400244- description: Install designate on primary node
245 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
246 -C "I@designate:server and *01*" state.sls designate.server
247 node_name: {{ HOSTNAME_CFG01 }}
248 retry: {count: 5, delay: 10}
249 skip_fail: false
250
251- description: Install designate on other nodes
252 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
253 -C "I@designate:server" state.sls designate
254 node_name: {{ HOSTNAME_CFG01 }}
255 retry: {count: 5, delay: 10}
256 skip_fail: false
257{%- endmacro %}
258
ibumarskovb5210062018-08-22 16:18:15 +0400259{%- macro MACRO_INSTALL_BARBICAN() %}
obutenkof009ed42018-11-12 14:50:51 +0200260
261- description: Install barbican server
262 cmd: |
obutenkobc4f4b22018-11-13 15:36:51 +0200263 salt -C 'I@barbican:server:role:primary' state.sls barbican.server;
264 salt -C 'I@barbican:server' state.sls barbican.server;
obutenkof009ed42018-11-12 14:50:51 +0200265 node_name: {{ HOSTNAME_CFG01 }}
266 retry: {count: 1, delay: 5}
267 skip_fail: false
268
269{%- endmacro %}
270
271{%- macro MACRO_INSTALL_DOGTAG() %}
272
273- description: Install dogtag server
274 cmd: |
275 salt -C 'I@dogtag:server:role:master' state.sls dogtag.server;
276 salt -C 'I@dogtag:server' state.sls dogtag.server;
277 node_name: {{ HOSTNAME_CFG01 }}
278 retry: {count: 1, delay: 5}
279 skip_fail: false
280
ibumarskovb5210062018-08-22 16:18:15 +0400281{%- endmacro %}
282
283{%- macro MACRO_INSTALL_IRONIC() %}
284# TO DO
285{%- endmacro %}
286
287{%- macro MACRO_INSTALL_MANILA() %}
Oleksii Butenkof57d1ff2018-09-28 17:59:45 +0300288- description: Install manila-api on first node
289 cmd: |
290 salt -C 'I@manila:api and *01*' state.sls manila.api;
291 node_name: {{ HOSTNAME_CFG01 }}
292 retry: {count: 1, delay: 5}
293 skip_fail: false
294
Oleksii Butenkof57d1ff2018-09-28 17:59:45 +0300295- description: Install manila-scheduler
296 cmd: |
297 salt -C 'I@manila:scheduler' state.sls manila.scheduler;
298 node_name: {{ HOSTNAME_CFG01 }}
299 retry: {count: 1, delay: 5}
300 skip_fail: false
301
302- description: Install manila-share
303 cmd: |
304 salt -C 'I@manila:share' state.sls manila.share;
305 node_name: {{ HOSTNAME_CFG01 }}
306 retry: {count: 1, delay: 5}
307 skip_fail: false
308
Oleksii Butenkof57d1ff2018-09-28 17:59:45 +0300309- description: Check manila-services
310 cmd: |
311 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila service-list'
312 node_name: {{ HOSTNAME_CFG01 }}
313 retry: {count: 3, delay: 15}
314 skip_fail: false
315
316- description: Create manila type
317 cmd: |
Oleksii Butenko40772422018-10-01 16:52:49 +0300318 salt -C "I@manila:client" state.sls manila.client
Oleksii Butenkof57d1ff2018-09-28 17:59:45 +0300319 node_name: {{ HOSTNAME_CFG01 }}
320 retry: {count: 1, delay: 5}
321 skip_fail: false
322
323- description: Create CIFS and NFS share and check it status
324 cmd: |
325 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create CIFS 1 --share-type=default';
326 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create NFS 1 --share-type=default';
327 sleep 5;
328 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila list';
329 node_name: {{ HOSTNAME_CFG01 }}
330 retry: {count: 1, delay: 5}
331 skip_fail: false
ibumarskovb5210062018-08-22 16:18:15 +0400332{%- endmacro %}
333
334{%- macro MACRO_INSTALL_OCTAVIA_API() %}
Tatyana Leontovich56a72412018-11-05 14:11:41 +0200335
336- description: Execute glance client to upload octavia image
337 cmd: salt -C 'I@glance:client' state.sls glance.client
338 node_name: {{ HOSTNAME_CFG01 }}
339 retry: {count: 1, delay: 5}
340 skip_fail: false
341
Tatyana Leontovichda703b92018-11-06 22:31:40 +0200342- description: Execute neutron client to create octavia resources
343 cmd: salt -C 'I@neutron:client' state.sls neutron.client
344 node_name: {{ HOSTNAME_CFG01 }}
345 retry: {count: 1, delay: 5}
346 skip_fail: false
347
Tatyana Leontovich931892e2018-10-18 14:27:12 +0300348- description: Install octavia api service on primary node
349 cmd: salt -C 'I@octavia:api:role:primary' state.sls octavia.api
350 node_name: {{ HOSTNAME_CFG01 }}
351 retry: {count: 1, delay: 5}
352 skip_fail: false
353
354- description: Install octavia api service
355 cmd: salt -C 'I@octavia:api' state.sls octavia.api
356 node_name: {{ HOSTNAME_CFG01 }}
357 retry: {count: 1, delay: 5}
358 skip_fail: false
359
360{%- endmacro %}
361
362{%- macro MACRO_INSTALL_OCTAVIA_MANAGER() %}
363- description: Update mine
364 cmd: salt -C 'I@neutron:client' mine.update && sleep 60
365 node_name: {{ HOSTNAME_CFG01 }}
366 retry: {count: 1, delay: 5}
367 skip_fail: false
368
369- description: Install octavia manager
370 cmd: salt -C 'I@octavia:manager' state.sls octavia.manager
371 node_name: {{ HOSTNAME_CFG01 }}
372 retry: {count: 1, delay: 5}
373 skip_fail: false
374
375- description: Execute octavia ca
376 cmd: salt -C 'I@octavia:manager' state.sls salt.minion.ca
377 node_name: {{ HOSTNAME_CFG01 }}
378 retry: {count: 1, delay: 5}
379 skip_fail: false
380
381- description: Execute octavia cert
382 cmd: salt -C 'I@octavia:manager' state.sls salt.minion.cert
383 node_name: {{ HOSTNAME_CFG01 }}
384 retry: {count: 1, delay: 5}
385 skip_fail: false
386
387- description: Execute octavia client
388 cmd: salt -C 'I@octavia:client' state.sls octavia.client
389 node_name: {{ HOSTNAME_CFG01 }}
390 retry: {count: 1, delay: 5}
391 skip_fail: false
392
ibumarskovb5210062018-08-22 16:18:15 +0400393{%- endmacro %}
394
Oleksii Butenkode0c5ee2018-09-24 15:29:45 +0300395{%- macro MACRO_INSTALL_COMPUTE(CELL_MAPPING=false) %}
Oleksii Butenko20947f22018-08-29 15:48:21 +0300396# Install compute node
397- description: Apply formulas for compute node
398 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
399 node_name: {{ HOSTNAME_CFG01 }}
400 retry: {count: 1, delay: 5}
401 skip_fail: true
402
403- description: Re-apply(as in doc) formulas for compute node
404 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
405 node_name: {{ HOSTNAME_CFG01 }}
406 retry: {count: 1, delay: 5}
407 skip_fail: false
408
409- description: Check IP on computes
410 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
411 'ip a'
412 node_name: {{ HOSTNAME_CFG01 }}
413 retry: {count: 10, delay: 30}
414 skip_fail: false
Oleksii Butenkode0c5ee2018-09-24 15:29:45 +0300415
416 {%- if CELL_MAPPING %}
417- description: Re-run nova for map cell mapping
418 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
419 -C "I@nova:controller and *01*" state.sls nova.controller
420 node_name: {{ HOSTNAME_CFG01 }}
421 retry: {count: 1, delay: 5}
422 skip_fail: false
423 {%- endif %}
Oleksii Butenko48f9a7b2018-10-11 14:04:45 +0300424{%- endmacro %}
Oleksii Butenkode0c5ee2018-09-24 15:29:45 +0300425
Oleksii Butenko48f9a7b2018-10-11 14:04:45 +0300426{%- macro MACRO_INSTALL_REDIS() %}
427- description: Install redis service
428 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@redis:cluster:role:master' state.sls redis &&
429 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@redis:server' state.sls redis
430 node_name: {{ HOSTNAME_CFG01 }}
431 retry: {count: 1, delay: 5}
432 skip_fail: false
433{%- endmacro %}
434
435{%- macro MACRO_INSTALL_GNOCCHI() %}
436- description: Install gnocchi server
437 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:server and *01*' state.sls gnocchi.server &&
438 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:server' state.sls gnocchi.server
439 node_name: {{ HOSTNAME_CFG01 }}
440 retry: {count: 1, delay: 5}
441 skip_fail: false
442
443- description: Setup gnocchi client
444 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:client and *01*' state.sls gnocchi.client &&
445 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:client' state.sls gnocchi.client
446 node_name: {{ HOSTNAME_CFG01 }}
447 retry: {count: 1, delay: 5}
448 skip_fail: false
449{%- endmacro %}
450
451{%- macro MACRO_INSTALL_PANKO() %}
452- description: Install panko server
453 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@panko:server and *01*' state.sls panko &&
454 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@panko:server' state.sls panko
455 node_name: {{ HOSTNAME_CFG01 }}
456 retry: {count: 1, delay: 5}
457 skip_fail: false
458{%- endmacro %}
459
460{%- macro MACRO_INSTALL_CEILOMETER() %}
461- description: Install ceilometer server on first node
462 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceilometer:server and *01*' state.sls ceilometer
463 node_name: {{ HOSTNAME_CFG01 }}
464 retry: {count: 2, delay: 5}
465 skip_fail: false
466
467- description: Install ceilometer server on other nodes
468 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceilometer:server' state.sls ceilometer
469 node_name: {{ HOSTNAME_CFG01 }}
470 retry: {count: 2, delay: 5}
471 skip_fail: false
472{%- endmacro %}
473
474{%- macro MACRO_INSTALL_AODH() %}
475- description: Install aodh server
476 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@aodh:server and *01*' state.sls aodh &&
477 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@aodh:server' state.sls aodh
478 node_name: {{ HOSTNAME_CFG01 }}
479 retry: {count: 1, delay: 5}
480 skip_fail: false
Oleksii Butenko20947f22018-08-29 15:48:21 +0300481{%- endmacro %}
Oleksii Butenkoffc09222018-09-21 12:37:16 +0300482
483{%- macro OVERRIDE_POLICY() %}
484- description: Upload policy override
485 upload:
486 local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/
487 local_filename: overrides-policy.yml
488 remote_path: /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/
489 node_name: {{ HOSTNAME_CFG01 }}
490
491- description: Create custom cluster control class
492 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
493 node_name: {{ HOSTNAME_CFG01 }}
494
495- description: Rename control classes
496 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 &&
497 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 &&
498 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all &&
499 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar
500 node_name: {{ HOSTNAME_CFG01 }}
Oleksii Butenkoc07e4062018-10-29 12:04:42 +0200501{%- endmacro %}