blob: dfa65e4293ba14eec301b26b351d142a415ff2e8 [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*'
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
Dennis Dmitriev4034db02018-08-26 21:50:13 +030095#- description: Setup glance.client
96# cmd: salt --hard-crash --state-output=mixed --state-verbose=False
97# -C 'I@glance:client' state.sls glance.client
98# node_name: {{ HOSTNAME_CFG01 }}
99# retry: {count: 1, delay: 5}
100# skip_fail: false
101
ibumarskovb5210062018-08-22 16:18:15 +0400102- description: Check glance image-list
103 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +0300104 -C "I@keystone:server" cmd.run ". /root/keystonercv3;
105 openstack image list"
ibumarskovb5210062018-08-22 16:18:15 +0400106 node_name: {{ HOSTNAME_CFG01 }}
107 retry: {count: 1, delay: 5}
108 skip_fail: false
109{%- endmacro %}
110
111{%- macro MACRO_INSTALL_NOVA() %}
112- description: Install nova service on primary node
113 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
114 -C "I@nova:controller and *01*" state.sls nova.controller
115 node_name: {{ HOSTNAME_CFG01 }}
116 retry: {count: 1, delay: 5}
117 skip_fail: false
118
119- description: Install nova service on other nodes
120 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
121 -C "I@nova:controller" state.sls nova.controller
122 node_name: {{ HOSTNAME_CFG01 }}
123 retry: {count: 1, delay: 5}
124 skip_fail: false
125
126- description: Check nova service-list
127 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +0300128 -C "I@keystone:server" cmd.run ". /root/keystonercv3;
129 openstack compute service list"
ibumarskovb5210062018-08-22 16:18:15 +0400130 node_name: {{ HOSTNAME_CFG01 }}
131 retry: {count: 1, delay: 5}
132 skip_fail: false
133
134- description: Check nova list
135 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +0300136 -C "I@keystone:server" cmd.run ". /root/keystonercv3;
137 openstack server list"
ibumarskovb5210062018-08-22 16:18:15 +0400138 node_name: {{ HOSTNAME_CFG01 }}
139 retry: {count: 1, delay: 5}
140 skip_fail: false
141{%- endmacro %}
142
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300143{%- macro MACRO_INSTALL_CINDER(INSTALL_VOLUME=false) %}
ibumarskovb5210062018-08-22 16:18:15 +0400144- description: Install cinder on primary node
145 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
146 -C "I@cinder:controller and *01*" state.sls cinder
147 node_name: {{ HOSTNAME_CFG01 }}
148 retry: {count: 1, delay: 5}
149 skip_fail: false
150
151- description: Install cinder on other nodes
152 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
153 -C "I@cinder:controller" state.sls cinder
154 node_name: {{ HOSTNAME_CFG01 }}
155 retry: {count: 1, delay: 5}
156 skip_fail: false
157
158- description: Check cinder list
159 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +0300160 -C "I@keystone:server" cmd.run ". /root/keystonercv3;
161 openstack volume list"
ibumarskovb5210062018-08-22 16:18:15 +0400162 node_name: {{ HOSTNAME_CFG01 }}
163 retry: {count: 1, delay: 5}
164 skip_fail: false
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300165
166 {%- if INSTALL_VOLUME %}
167- description: Install cinder volume
168 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
169 -C 'I@cinder:volume' state.sls cinder
170 node_name: {{ HOSTNAME_CFG01 }}
171 retry: {count: 1, delay: 5}
172 skip_fail: false
173 {%- endif %}
174
ibumarskovb5210062018-08-22 16:18:15 +0400175{%- endmacro %}
176
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300177{%- macro MACRO_INSTALL_NEUTRON(INSTALL_GATEWAY=true) %}
ibumarskovb5210062018-08-22 16:18:15 +0400178- description: Install neutron service on primary node
179 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
180 -C "I@neutron:server and *01*" state.sls neutron.server
181 node_name: {{ HOSTNAME_CFG01 }}
182 retry: {count: 1, delay: 5}
183 skip_fail: false
184
185- description: Install neutron service on other nodes
186 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
187 -C "I@neutron:server" state.sls neutron.server
188 node_name: {{ HOSTNAME_CFG01 }}
189 retry: {count: 1, delay: 5}
190 skip_fail: false
191
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300192 {%- if INSTALL_GATEWAY %}
ibumarskovb5210062018-08-22 16:18:15 +0400193- description: Install neutron on gtw node
194 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
195 -C 'I@neutron:gateway' state.sls neutron
196 node_name: {{ HOSTNAME_CFG01 }}
197 retry: {count: 1, delay: 5}
198 skip_fail: false
199
200- description: Check neutron agent-list
201 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
202 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
203 node_name: {{ HOSTNAME_CFG01 }}
204 retry: {count: 1, delay: 5}
205 skip_fail: false
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300206 {%- endif %}
207
ibumarskovb5210062018-08-22 16:18:15 +0400208{%- endmacro %}
209
210{%- macro MACRO_INSTALL_HEAT() %}
211- description: Install heat service on primary node
212 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
213 -C "I@heat:server and *01*" state.sls heat.server
214 node_name: {{ HOSTNAME_CFG01 }}
215 retry: {count: 1, delay: 5}
216 skip_fail: false
217
218- description: Install heat service on other nodes
219 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
220 -C "I@heat:server" state.sls heat.server
221 node_name: {{ HOSTNAME_CFG01 }}
222 retry: {count: 1, delay: 5}
223 skip_fail: false
224
225- description: Check heat service
226 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Oleksii Butenko8b49a762018-09-18 11:46:35 +0300227 -C 'I@keystone:server' cmd.run '. /root/keystonercv3;
228 openstack orchestration resource type list'
ibumarskovb5210062018-08-22 16:18:15 +0400229 node_name: {{ HOSTNAME_CFG01 }}
230 retry: {count: 5, delay: 10}
231 skip_fail: false
232{%- endmacro %}
233
234{%- macro MACRO_INSTALL_HORIZON() %}
235- description: Deploy horizon dashboard
236 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
237 -C 'I@horizon:server' state.sls horizon
238 node_name: {{ HOSTNAME_CFG01 }}
239 retry: {count: 1, delay: 5}
240 skip_fail: true
241
242- description: Deploy nginx proxy
243 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
244 -C 'I@nginx:server' state.sls nginx
245 node_name: {{ HOSTNAME_CFG01 }}
246 retry: {count: 1, delay: 5}
247 skip_fail: true
248{%- endmacro %}
249
250{%- macro MACRO_INSTALL_DESIGNATE() %}
251# Note: deploy backend for designate firstly
252- description: Install designate on primary node
253 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
254 -C "I@designate:server and *01*" state.sls designate.server
255 node_name: {{ HOSTNAME_CFG01 }}
256 retry: {count: 5, delay: 10}
257 skip_fail: false
258
259- description: Install designate on other nodes
260 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
261 -C "I@designate:server" state.sls designate
262 node_name: {{ HOSTNAME_CFG01 }}
263 retry: {count: 5, delay: 10}
264 skip_fail: false
265{%- endmacro %}
266
267{%- macro MACRO_INSTALL_CEILOMETER() %}
268# TO DO
269{%- endmacro %}
270
271{%- macro MACRO_INSTALL_BARBICAN() %}
272# TO DO
273{%- endmacro %}
274
275{%- macro MACRO_INSTALL_IRONIC() %}
276# TO DO
277{%- endmacro %}
278
279{%- macro MACRO_INSTALL_MANILA() %}
280# TO DO
281{%- endmacro %}
282
283{%- macro MACRO_INSTALL_OCTAVIA_API() %}
284# TO DO
285{%- endmacro %}
286
287{%- macro MACRO_INSTALL_DOGTAG() %}
288# TO DO
289{%- endmacro %}
290
291{%- macro MACRO_INSTALL_GNOCCHI() %}
292# TO DO
293{%- endmacro %}
294
295{%- macro MACRO_INSTALL_AODH() %}
296# TO DO
297{%- endmacro %}
Oleksii Butenko20947f22018-08-29 15:48:21 +0300298
299{%- macro MACRO_INSTALL_COMPUTE() %}
300# Install compute node
301- description: Apply formulas for compute node
302 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
303 node_name: {{ HOSTNAME_CFG01 }}
304 retry: {count: 1, delay: 5}
305 skip_fail: true
306
307- description: Re-apply(as in doc) formulas for compute node
308 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
309 node_name: {{ HOSTNAME_CFG01 }}
310 retry: {count: 1, delay: 5}
311 skip_fail: false
312
313- description: Check IP on computes
314 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
315 'ip a'
316 node_name: {{ HOSTNAME_CFG01 }}
317 retry: {count: 10, delay: 30}
318 skip_fail: false
319{%- endmacro %}