blob: abed769c390f7336bee77763ef35ca962edefc8f [file] [log] [blame]
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +02001{% from 'virtual-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'virtual-mcp-pike-dvr/underlay.yaml' import HOSTNAME_GTW01 with context %}
Oleksii Butenkoc05c9f62018-04-19 19:00:02 +03006{% from 'virtual-mcp-pike-dvr/underlay.yaml' import LAB_CONFIG_NAME with context %}
7{% from 'virtual-mcp-pike-dvr/underlay.yaml' import DOMAIN_NAME with context %}
Tatyana Leontovich56005da2017-12-11 13:16:51 +02008{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
9{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +020010{% set OVERRIDE_POLICY = os_env('OVERRIDE_POLICY', '') %}
Oleksii Butenkoc05c9f62018-04-19 19:00:02 +030011{% import 'shared-salt.yaml' as SHARED with context %}
Tatyana Leontovich4f613672018-06-12 21:41:19 +030012{% import 'shared-backup-restore.yaml' as BACKUP with context %}
Tatyana Leontovich56005da2017-12-11 13:16:51 +020013
14# Install OpenStack control services
15
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +020016{%- if OVERRIDE_POLICY != '' %}
17- description: Upload policy override
18 upload:
19 local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/
20 local_filename: overrides-policy.yml
21 remote_path: /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/
22 node_name: {{ HOSTNAME_CFG01 }}
23
24- description: Create custom cluster control class
25 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
26 node_name: {{ HOSTNAME_CFG01 }}
27
28- description: Rename control classes
29 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 &&
30 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 &&
31 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all &&
32 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar
33 node_name: {{ HOSTNAME_CFG01 }}
34{%- endif %}
35
Tatyana Leontovich56005da2017-12-11 13:16:51 +020036- description: Install glance on all controllers
37 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
38 -C 'I@glance:server' state.sls glance -b 1
39 node_name: {{ HOSTNAME_CFG01 }}
40 retry: {count: 1, delay: 5}
41 skip_fail: false
42
43- description: Install keystone service (note that different fernet keys are created on different nodes)
44 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
45 -C 'I@keystone:server' state.sls keystone.server -b 1
46 node_name: {{ HOSTNAME_CFG01 }}
47 retry: {count: 2, delay: 15}
48 skip_fail: false
49
50- description: Restart apache due to PROD-10477
51 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
52 node_name: {{ HOSTNAME_CFG01 }}
53 retry: {count: 1, delay: 15}
54 skip_fail: false
55
56- description: Check apache status to PROD-10477
57 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
58 node_name: {{ HOSTNAME_CFG01 }}
59 retry: {count: 1, delay: 15}
60 skip_fail: false
61
62- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
63 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
64 -C 'I@glance:server' state.sls glusterfs.client
65 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 1, delay: 5}
67 skip_fail: false
68
69- description: Update fernet keys for keystone server on the mounted glusterfs volume
70 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
71 -C 'I@keystone:server' state.sls keystone.server -b 1
72 node_name: {{ HOSTNAME_CFG01 }}
73 retry: {count: 1, delay: 5}
74 skip_fail: false
75
76- description: Populate keystone services/tenants/admins
77 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
78 -C 'I@keystone:client' state.sls keystone.client
79 node_name: {{ HOSTNAME_CFG01 }}
Dennis Dmitrievf073e6f2018-02-06 23:45:15 +020080 retry: {count: 2, delay: 5}
Tatyana Leontovich56005da2017-12-11 13:16:51 +020081 skip_fail: false
82
83- description: Check keystone service-list
84 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
85 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
86 node_name: {{ HOSTNAME_CFG01 }}
87 retry: {count: 1, delay: 5}
88 skip_fail: false
89
90- description: Check glance image-list
91 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +020092 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
Tatyana Leontovich56005da2017-12-11 13:16:51 +020093 node_name: {{ HOSTNAME_CFG01 }}
94 retry: {count: 1, delay: 5}
95 skip_fail: false
96
97
98- description: Install nova on all controllers
99 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
100 -C 'I@nova:controller' state.sls nova -b 1
101 node_name: {{ HOSTNAME_CFG01 }}
102 retry: {count: 2, delay: 5}
103 skip_fail: false
104
105- description: Check nova service-list
106 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +0200107 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200108 node_name: {{ HOSTNAME_CFG01 }}
109 retry: {count: 3, delay: 5}
110 skip_fail: false
111
112
113- description: Install cinder
114 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
115 -C 'I@cinder:controller' state.sls cinder -b 1
116 node_name: {{ HOSTNAME_CFG01 }}
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +0200117 retry: {count: 1, delay: 5}
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200118 skip_fail: false
119
120- description: Check cinder list
121 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +0200122 -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200123 node_name: {{ HOSTNAME_CFG01 }}
124 retry: {count: 1, delay: 5}
125 skip_fail: false
126
127
128- description: Install neutron service
129 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
130 -C 'I@neutron:server' state.sls neutron -b 1
131 node_name: {{ HOSTNAME_CFG01 }}
132 retry: {count: 1, delay: 5}
133 skip_fail: false
134
135- description: Install neutron on gtw node
136 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
137 -C 'I@neutron:gateway' state.sls neutron
138 node_name: {{ HOSTNAME_CFG01 }}
139 retry: {count: 1, delay: 5}
140 skip_fail: false
141
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +0200142# isntall designate
143- description: Install powerdns
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200144 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +0200145 -C 'I@powerdns:server' state.sls powerdns.server
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200146 node_name: {{ HOSTNAME_CFG01 }}
147 retry: {count: 1, delay: 5}
148 skip_fail: false
149
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +0200150- description: Install designate
151 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
152 -C 'I@designate:server' state.sls designate -b 1
153 node_name: {{ HOSTNAME_CFG01 }}
154 retry: {count: 5, delay: 10}
155 skip_fail: false
156
157- description: Check neutron agent-list
158 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
159 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
160 node_name: {{ HOSTNAME_CFG01 }}
161 retry: {count: 1, delay: 5}
162 skip_fail: false
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200163
164- description: Install heat service
165 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
166 -C 'I@heat:server' state.sls heat -b 1
167 node_name: {{ HOSTNAME_CFG01 }}
168 retry: {count: 1, delay: 5}
169 skip_fail: false
170
171- description: Check heat service
172 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
173 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
174 node_name: {{ HOSTNAME_CFG01 }}
175 retry: {count: 5, delay: 10}
176 skip_fail: false
177
178
179- description: Deploy horizon dashboard
180 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
181 -C 'I@horizon:server' state.sls horizon
182 node_name: {{ HOSTNAME_CFG01 }}
183 retry: {count: 1, delay: 5}
184 skip_fail: true
185
186- description: Deploy nginx proxy
187 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
188 -C 'I@nginx:server' state.sls nginx
189 node_name: {{ HOSTNAME_CFG01 }}
190 retry: {count: 1, delay: 5}
191 skip_fail: true
192
193
194# Install compute node
195
196- description: Apply formulas for compute node
197 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
198 node_name: {{ HOSTNAME_CFG01 }}
199 retry: {count: 1, delay: 5}
200 skip_fail: true
201
202- description: Re-apply(as in doc) formulas for compute node
203 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
204 node_name: {{ HOSTNAME_CFG01 }}
205 retry: {count: 1, delay: 5}
Oleksii Butenko9f2601c2018-02-08 15:13:21 +0200206 skip_fail: false
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200207
208- description: Check IP on computes
209 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
210 'ip a'
211 node_name: {{ HOSTNAME_CFG01 }}
212 retry: {count: 10, delay: 30}
213 skip_fail: false
214
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200215- description: Create net04_external
216 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
217 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
218 node_name: {{ HOSTNAME_CFG01 }}
219 retry: {count: 1, delay: 30}
220 skip_fail: false
221
222- description: Create subnet_external
223 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
224 '. /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'
225 node_name: {{ HOSTNAME_CFG01 }}
226 retry: {count: 1, delay: 30}
227 skip_fail: false
228
229- description: Create net04
230 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
231 '. /root/keystonercv3; neutron net-create net04'
232 node_name: {{ HOSTNAME_CFG01 }}
233 retry: {count: 1, delay: 30}
234 skip_fail: false
235
236- description: Create subnet_net04
237 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
Tatyana Leontovich7305c412018-04-27 00:26:27 +0300238 '. /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 }}.180'
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200239 node_name: {{ HOSTNAME_CFG01 }}
240 retry: {count: 1, delay: 30}
241 skip_fail: false
242
243- description: Create router
244 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
245 '. /root/keystonercv3; neutron router-create net04_router01'
246 node_name: {{ HOSTNAME_CFG01 }}
247 retry: {count: 1, delay: 30}
248 skip_fail: false
249
250- description: Set geteway
251 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
252 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
253 node_name: {{ HOSTNAME_CFG01 }}
254 retry: {count: 1, delay: 30}
255 skip_fail: false
256
257- description: Add interface
258 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
259 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
260 node_name: {{ HOSTNAME_CFG01 }}
261 retry: {count: 1, delay: 30}
262 skip_fail: false
263
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200264- description: sync time
265 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
266 'service ntp stop; ntpd -gq; service ntp start'
267 node_name: {{ HOSTNAME_CFG01 }}
268 retry: {count: 1, delay: 30}
269 skip_fail: false
270
sgudz3fd44542018-04-02 11:45:49 +0300271- description: Install manila-api on first node
272 cmd: |
273 salt -C 'I@manila:api and *01*' state.sls manila.api;
274 node_name: {{ HOSTNAME_CFG01 }}
275 retry: {count: 1, delay: 5}
276 skip_fail: false
277
278- description: Install manila-api on other nodes
279 cmd: |
280 salt -C 'I@manila:api and not *01*' state.sls manila.api;
281 node_name: {{ HOSTNAME_CFG01 }}
282 retry: {count: 1, delay: 5}
283 skip_fail: false
284
285- description: Install manila-scheduler
286 cmd: |
287 salt -C 'I@manila:scheduler' state.sls manila.scheduler;
288 node_name: {{ HOSTNAME_CFG01 }}
289 retry: {count: 1, delay: 5}
290 skip_fail: false
291
292- description: Install manila-share
293 cmd: |
294 salt -C 'I@manila:share' state.sls manila.share;
295 node_name: {{ HOSTNAME_CFG01 }}
296 retry: {count: 1, delay: 5}
297 skip_fail: false
298
Tatyana Leontovich3cc1c132018-04-03 00:41:17 +0300299- description: WR https://mirantis.jira.com/browse/PROD-19012
300 cmd: |
Tatyana Leontovich1618a2a2018-04-03 10:19:25 +0300301 salt 'ctl*' cmd.run 'systemctl restart apache2'
Tatyana Leontovich3cc1c132018-04-03 00:41:17 +0300302 node_name: {{ HOSTNAME_CFG01 }}
303 retry: {count: 1, delay: 5}
304 skip_fail: false
305
sgudz3fd44542018-04-02 11:45:49 +0300306- description: Check manila-services
307 cmd: |
308 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila service-list'
309 node_name: {{ HOSTNAME_CFG01 }}
Tatyana Leontovich1618a2a2018-04-03 10:19:25 +0300310 retry: {count: 3, delay: 15}
sgudz3fd44542018-04-02 11:45:49 +0300311 skip_fail: false
312
313- description: Create manila type
314 cmd: |
sgudz1d658402018-04-06 11:59:48 +0300315 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila type-create default false --create_share_from_snapshot_support true --revert_to_snapshot_support true --mount_snapshot_support true --snapshot_support true --is_public true'
sgudz3fd44542018-04-02 11:45:49 +0300316 node_name: {{ HOSTNAME_CFG01 }}
317 retry: {count: 1, delay: 5}
318 skip_fail: false
319
320- description: Create CIFS and NFS share and check it status
321 cmd: |
322 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create CIFS 1 --share-type=default';
323 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create NFS 1 --share-type=default';
324 sleep 5;
325 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila list';
326 node_name: {{ HOSTNAME_CFG01 }}
327 retry: {count: 1, delay: 5}
328 skip_fail: false
Oleksii Butenkoc05c9f62018-04-19 19:00:02 +0300329
Tatyana Leontovich92063ef2018-07-04 14:28:09 +0300330{{ BACKUP.MACRO_WR_NGINX_MASTER() }}
Tatyana Leontovich4f613672018-06-12 21:41:19 +0300331{{ BACKUP.MACRO_BACKUP_BACKUPNINJA() }}
332{{ BACKUP.MACRO_BACKUP_XTRABACKUP() }}
Oleksii Butenko5cd0a162018-06-14 18:18:10 +0300333{{ SHARED.INSTALL_DOCKER_ON_GTW() }}