blob: 9e0a1ff9735d3b9a5b316242efab0ee1d0fc0036 [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: |
6 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*'
31 cmd.run "systemctl restart apache2"
32 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*'
38 cmd.run "systemctl status apache2"
39 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
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{%- endmacro %}
71
72{%- macro MACRO_INSTALL_GLANCE() %}
73- description: Install glance service on primary node
74 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
75 -C 'I@glance:server and *01*' state.sls glance.server
76 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 1, delay: 5}
78 skip_fail: false
79
80- description: Install glance service on other nodes
81 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
82 -C 'I@glance:server' state.sls glance.server
83 node_name: {{ HOSTNAME_CFG01 }}
84 retry: {count: 1, delay: 5}
85 skip_fail: false
86
Dennis Dmitriev4034db02018-08-26 21:50:13 +030087- description: Mount glusterfs.client volumes (resuires created 'glusterfs' system user)
ibumarskovb5210062018-08-22 16:18:15 +040088 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Dennis Dmitriev4034db02018-08-26 21:50:13 +030089 -C 'I@glance:server' state.sls glusterfs.client -b 1
ibumarskovb5210062018-08-22 16:18:15 +040090 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 1, delay: 5}
92 skip_fail: false
93
Dennis Dmitriev4034db02018-08-26 21:50:13 +030094#- description: Setup glance.client
95# cmd: salt --hard-crash --state-output=mixed --state-verbose=False
96# -C 'I@glance:client' state.sls glance.client
97# node_name: {{ HOSTNAME_CFG01 }}
98# retry: {count: 1, delay: 5}
99# skip_fail: false
100
ibumarskovb5210062018-08-22 16:18:15 +0400101- description: Check glance image-list
102 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
103 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
104 node_name: {{ HOSTNAME_CFG01 }}
105 retry: {count: 1, delay: 5}
106 skip_fail: false
107{%- endmacro %}
108
109{%- macro MACRO_INSTALL_NOVA() %}
110- description: Install nova service on primary node
111 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
112 -C "I@nova:controller and *01*" state.sls nova.controller
113 node_name: {{ HOSTNAME_CFG01 }}
114 retry: {count: 1, delay: 5}
115 skip_fail: false
116
117- description: Install nova service on other nodes
118 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
119 -C "I@nova:controller" state.sls nova.controller
120 node_name: {{ HOSTNAME_CFG01 }}
121 retry: {count: 1, delay: 5}
122 skip_fail: false
123
124- description: Check nova service-list
125 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
126 -C "I@keystone:server" cmd.run ". /root/keystonercv3; nova
127 --debug service-list"
128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 1, delay: 5}
130 skip_fail: false
131
132- description: Check nova list
133 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
134 -C "I@keystone:server" cmd.run ". /root/keystonercv3; nova --debug list"
135 node_name: {{ HOSTNAME_CFG01 }}
136 retry: {count: 1, delay: 5}
137 skip_fail: false
138{%- endmacro %}
139
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300140{%- macro MACRO_INSTALL_CINDER(INSTALL_VOLUME=false) %}
ibumarskovb5210062018-08-22 16:18:15 +0400141- description: Install cinder on primary node
142 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
143 -C "I@cinder:controller and *01*" state.sls cinder
144 node_name: {{ HOSTNAME_CFG01 }}
145 retry: {count: 1, delay: 5}
146 skip_fail: false
147
148- description: Install cinder on other nodes
149 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
150 -C "I@cinder:controller" state.sls cinder
151 node_name: {{ HOSTNAME_CFG01 }}
152 retry: {count: 1, delay: 5}
153 skip_fail: false
154
155- description: Check cinder list
156 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
157 -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
158 node_name: {{ HOSTNAME_CFG01 }}
159 retry: {count: 1, delay: 5}
160 skip_fail: false
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300161
162 {%- if INSTALL_VOLUME %}
163- description: Install cinder volume
164 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
165 -C 'I@cinder:volume' state.sls cinder
166 node_name: {{ HOSTNAME_CFG01 }}
167 retry: {count: 1, delay: 5}
168 skip_fail: false
169 {%- endif %}
170
ibumarskovb5210062018-08-22 16:18:15 +0400171{%- endmacro %}
172
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300173{%- macro MACRO_INSTALL_NEUTRON(INSTALL_GATEWAY=true) %}
ibumarskovb5210062018-08-22 16:18:15 +0400174- description: Install neutron service on primary node
175 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
176 -C "I@neutron:server and *01*" state.sls neutron.server
177 node_name: {{ HOSTNAME_CFG01 }}
178 retry: {count: 1, delay: 5}
179 skip_fail: false
180
181- description: Install neutron service on other nodes
182 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
183 -C "I@neutron:server" state.sls neutron.server
184 node_name: {{ HOSTNAME_CFG01 }}
185 retry: {count: 1, delay: 5}
186 skip_fail: false
187
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300188 {%- if INSTALL_GATEWAY %}
ibumarskovb5210062018-08-22 16:18:15 +0400189- description: Install neutron on gtw node
190 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
191 -C 'I@neutron:gateway' state.sls neutron
192 node_name: {{ HOSTNAME_CFG01 }}
193 retry: {count: 1, delay: 5}
194 skip_fail: false
195
196- description: Check neutron agent-list
197 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
198 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
199 node_name: {{ HOSTNAME_CFG01 }}
200 retry: {count: 1, delay: 5}
201 skip_fail: false
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300202 {%- endif %}
203
ibumarskovb5210062018-08-22 16:18:15 +0400204{%- endmacro %}
205
206{%- macro MACRO_INSTALL_HEAT() %}
207- description: Install heat service on primary node
208 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
209 -C "I@heat:server and *01*" state.sls heat.server
210 node_name: {{ HOSTNAME_CFG01 }}
211 retry: {count: 1, delay: 5}
212 skip_fail: false
213
214- description: Install heat service on other nodes
215 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
216 -C "I@heat:server" state.sls heat.server
217 node_name: {{ HOSTNAME_CFG01 }}
218 retry: {count: 1, delay: 5}
219 skip_fail: false
220
221- description: Check heat service
222 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
223 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
224 node_name: {{ HOSTNAME_CFG01 }}
225 retry: {count: 5, delay: 10}
226 skip_fail: false
227{%- endmacro %}
228
229{%- macro MACRO_INSTALL_HORIZON() %}
230- description: Deploy horizon dashboard
231 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
232 -C 'I@horizon:server' state.sls horizon
233 node_name: {{ HOSTNAME_CFG01 }}
234 retry: {count: 1, delay: 5}
235 skip_fail: true
236
237- description: Deploy nginx proxy
238 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
239 -C 'I@nginx:server' state.sls nginx
240 node_name: {{ HOSTNAME_CFG01 }}
241 retry: {count: 1, delay: 5}
242 skip_fail: true
243{%- endmacro %}
244
245{%- macro MACRO_INSTALL_DESIGNATE() %}
246# Note: deploy backend for designate firstly
247- description: Install designate on primary node
248 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
249 -C "I@designate:server and *01*" state.sls designate.server
250 node_name: {{ HOSTNAME_CFG01 }}
251 retry: {count: 5, delay: 10}
252 skip_fail: false
253
254- description: Install designate on other nodes
255 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
256 -C "I@designate:server" state.sls designate
257 node_name: {{ HOSTNAME_CFG01 }}
258 retry: {count: 5, delay: 10}
259 skip_fail: false
260{%- endmacro %}
261
262{%- macro MACRO_INSTALL_CEILOMETER() %}
263# TO DO
264{%- endmacro %}
265
266{%- macro MACRO_INSTALL_BARBICAN() %}
267# TO DO
268{%- endmacro %}
269
270{%- macro MACRO_INSTALL_IRONIC() %}
271# TO DO
272{%- endmacro %}
273
274{%- macro MACRO_INSTALL_MANILA() %}
275# TO DO
276{%- endmacro %}
277
278{%- macro MACRO_INSTALL_OCTAVIA_API() %}
279# TO DO
280{%- endmacro %}
281
282{%- macro MACRO_INSTALL_DOGTAG() %}
283# TO DO
284{%- endmacro %}
285
286{%- macro MACRO_INSTALL_GNOCCHI() %}
287# TO DO
288{%- endmacro %}
289
290{%- macro MACRO_INSTALL_AODH() %}
291# TO DO
292{%- endmacro %}
Oleksii Butenko20947f22018-08-29 15:48:21 +0300293
294{%- macro MACRO_INSTALL_COMPUTE() %}
295# Install compute node
296- description: Apply formulas for compute node
297 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
298 node_name: {{ HOSTNAME_CFG01 }}
299 retry: {count: 1, delay: 5}
300 skip_fail: true
301
302- description: Re-apply(as in doc) formulas for compute node
303 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
304 node_name: {{ HOSTNAME_CFG01 }}
305 retry: {count: 1, delay: 5}
306 skip_fail: false
307
308- description: Check IP on computes
309 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
310 'ip a'
311 node_name: {{ HOSTNAME_CFG01 }}
312 retry: {count: 10, delay: 30}
313 skip_fail: false
314{%- endmacro %}