blob: fab3eceda158001b079daa1361a7c91d972d3841 [file] [log] [blame]
Tatyana Leontovichc447b122018-02-22 12:30:42 +02001{% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_GTW01 with context %}
Oleksii Butenkoc05c9f62018-04-19 19:00:02 +03006{% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import LAB_CONFIG_NAME with context %}
7{% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import DOMAIN_NAME with context %}
Tatyana Leontovichc447b122018-02-22 12:30:42 +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 Leontovichc447b122018-02-22 12:30:42 +020010{% set OVERRIDE_POLICY = os_env('OVERRIDE_POLICY', '') %}
Oleksii Butenkoc05c9f62018-04-19 19:00:02 +030011{% import 'shared-salt.yaml' as SHARED with context %}
12
Tatyana Leontovichc447b122018-02-22 12:30:42 +020013
14# Install OpenStack control services
15
16{%- 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
36- description: Nginx
37 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
38 -C 'I@nginx:server' state.sls salt.minion
39 node_name: {{ HOSTNAME_CFG01 }}
40 retry: {count: 1, delay: 5}
41 skip_fail: true
42
43- description: Deploy nginx proxy
44 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
45 -C 'I@nginx:server' state.sls nginx
46 node_name: {{ HOSTNAME_CFG01 }}
47 retry: {count: 1, delay: 5}
48 skip_fail: true
49
50- description: Install glance on all controllers
51 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
52 -C 'I@glance:server' state.sls glance -b 1
53 node_name: {{ HOSTNAME_CFG01 }}
54 retry: {count: 1, delay: 5}
55 skip_fail: false
56
57- description: Install keystone service (note that different fernet keys are created on different nodes)
58 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
59 -C 'I@keystone:server' state.sls keystone.server -b 1
60 node_name: {{ HOSTNAME_CFG01 }}
61 retry: {count: 2, delay: 15}
62 skip_fail: false
63
64- description: Restart apache due to PROD-10477
65 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
66 node_name: {{ HOSTNAME_CFG01 }}
67 retry: {count: 1, delay: 15}
68 skip_fail: false
69
70- description: Check apache status to PROD-10477
71 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
72 node_name: {{ HOSTNAME_CFG01 }}
73 retry: {count: 1, delay: 15}
74 skip_fail: false
75
76- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
77 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
78 -C 'I@glance:server' state.sls glusterfs.client
79 node_name: {{ HOSTNAME_CFG01 }}
80 retry: {count: 1, delay: 5}
81 skip_fail: false
82
83- description: Update fernet keys for keystone server on the mounted glusterfs volume
84 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
85 -C 'I@keystone:server' state.sls keystone.server -b 1
86 node_name: {{ HOSTNAME_CFG01 }}
87 retry: {count: 1, delay: 5}
88 skip_fail: false
89
90- description: Populate keystone services/tenants/admins
91 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
92 -C 'I@keystone:client' state.sls keystone.client
93 node_name: {{ HOSTNAME_CFG01 }}
94 retry: {count: 2, delay: 5}
95 skip_fail: false
96
97- description: Check keystone service-list
98 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
99 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
100 node_name: {{ HOSTNAME_CFG01 }}
101 retry: {count: 1, delay: 5}
102 skip_fail: false
103
104- description: Check glance image-list
105 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
106 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
107 node_name: {{ HOSTNAME_CFG01 }}
108 retry: {count: 1, delay: 5}
109 skip_fail: false
110
111
112- description: Install nova on all controllers
113 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
114 -C 'I@nova:controller' state.sls nova -b 1
115 node_name: {{ HOSTNAME_CFG01 }}
116 retry: {count: 2, delay: 5}
117 skip_fail: false
118
119- description: Check nova service-list
120 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
121 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
122 node_name: {{ HOSTNAME_CFG01 }}
123 retry: {count: 3, delay: 5}
124 skip_fail: false
125
126
127- description: Install cinder
128 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
129 -C 'I@cinder:controller' state.sls cinder -b 1
130 node_name: {{ HOSTNAME_CFG01 }}
131 retry: {count: 1, delay: 5}
132 skip_fail: false
133
134- description: Check cinder list
135 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
136 -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
137 node_name: {{ HOSTNAME_CFG01 }}
138 retry: {count: 1, delay: 5}
139 skip_fail: false
140
141
142- description: Install neutron service
143 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
144 -C 'I@neutron:server' state.sls neutron -b 1
145 node_name: {{ HOSTNAME_CFG01 }}
146 retry: {count: 1, delay: 5}
147 skip_fail: false
148
149- description: Install neutron on gtw node
150 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
151 -C 'I@neutron:gateway' state.sls neutron
152 node_name: {{ HOSTNAME_CFG01 }}
153 retry: {count: 1, delay: 5}
154 skip_fail: false
155
156# isntall designate
157- description: Install powerdns
158 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
159 -C 'I@powerdns:server' state.sls powerdns.server
160 node_name: {{ HOSTNAME_CFG01 }}
161 retry: {count: 1, delay: 5}
162 skip_fail: false
163
164- description: Install designate
165 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
166 -C 'I@designate:server' state.sls designate -b 1
167 node_name: {{ HOSTNAME_CFG01 }}
168 retry: {count: 5, delay: 10}
169 skip_fail: false
170
171- description: Check neutron agent-list
172 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
173 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
174 node_name: {{ HOSTNAME_CFG01 }}
175 retry: {count: 1, delay: 5}
176 skip_fail: false
177
178- description: Install heat service
179 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
180 -C 'I@heat:server' state.sls heat -b 1
181 node_name: {{ HOSTNAME_CFG01 }}
182 retry: {count: 1, delay: 5}
183 skip_fail: false
184
185- description: Check heat service
186 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
187 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
188 node_name: {{ HOSTNAME_CFG01 }}
189 retry: {count: 5, delay: 10}
190 skip_fail: false
191
192
193- description: Deploy horizon dashboard
194 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
195 -C 'I@horizon:server' state.sls horizon
196 node_name: {{ HOSTNAME_CFG01 }}
197 retry: {count: 1, delay: 5}
198 skip_fail: true
199
200# Install compute node
201
202- description: Apply 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}
206 skip_fail: true
207
208- description: Re-apply(as in doc) formulas for compute node
209 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
210 node_name: {{ HOSTNAME_CFG01 }}
211 retry: {count: 1, delay: 5}
212 skip_fail: false
213
214- description: Check IP on computes
215 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
216 'ip a'
217 node_name: {{ HOSTNAME_CFG01 }}
218 retry: {count: 10, delay: 30}
219 skip_fail: false
220
221
222 # Upload cirros image
223
224- description: Upload cirros image on ctl01
225 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
226 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
227 node_name: {{ HOSTNAME_CFG01 }}
228 retry: {count: 2, delay: 30}
229 skip_fail: false
230
231- description: Register image in glance
232 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
233 '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-0.3.4-i386-disk.img'
234 node_name: {{ HOSTNAME_CFG01 }}
235 retry: {count: 1, delay: 30}
236 skip_fail: false
237
238- description: Create net04_external
239 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
240 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
241 node_name: {{ HOSTNAME_CFG01 }}
242 retry: {count: 1, delay: 30}
243 skip_fail: false
244
245- description: Create subnet_external
246 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
247 '. /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'
248 node_name: {{ HOSTNAME_CFG01 }}
249 retry: {count: 1, delay: 30}
250 skip_fail: false
251
252- description: Create net04
253 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
254 '. /root/keystonercv3; neutron net-create net04'
255 node_name: {{ HOSTNAME_CFG01 }}
256 retry: {count: 1, delay: 30}
257 skip_fail: false
258
259- description: Create subnet_net04
260 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
261 '. /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 }}.240'
262 node_name: {{ HOSTNAME_CFG01 }}
263 retry: {count: 1, delay: 30}
264 skip_fail: false
265
266- description: Create router
267 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
268 '. /root/keystonercv3; neutron router-create net04_router01'
269 node_name: {{ HOSTNAME_CFG01 }}
270 retry: {count: 1, delay: 30}
271 skip_fail: false
272
273- description: Set geteway
274 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
275 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
276 node_name: {{ HOSTNAME_CFG01 }}
277 retry: {count: 1, delay: 30}
278 skip_fail: false
279
280- description: Add interface
281 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
282 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
283 node_name: {{ HOSTNAME_CFG01 }}
284 retry: {count: 1, delay: 30}
285 skip_fail: false
286
287#- description: Allow all tcp
288# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
289# '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
290# node_name: {{ HOSTNAME_CFG01 }}
291# retry: {count: 1, delay: 30}
292# skip_fail: false
293#
294#- description: Allow all icmp
295# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
296# '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
297# node_name: {{ HOSTNAME_CFG01 }}
298# retry: {count: 1, delay: 30}
299# skip_fail: false
300
301- description: sync time
302 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
303 'service ntp stop; ntpd -gq; service ntp start'
304 node_name: {{ HOSTNAME_CFG01 }}
305 retry: {count: 1, delay: 30}
306 skip_fail: false
307
308# Configure cinder-volume salt-call PROD-13167
309- description: Set disks 01
310 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
311 node_name: {{ HOSTNAME_CTL01 }}
312 retry: {count: 1, delay: 30}
313 skip_fail: false
314
315- description: Set disks 02
316 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
317 node_name: {{ HOSTNAME_CTL02 }}
318 retry: {count: 1, delay: 30}
319 skip_fail: false
320
321- description: Set disks 03
322 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
323 node_name: {{ HOSTNAME_CTL03 }}
324 retry: {count: 1, delay: 30}
325 skip_fail: false
326
327- description: Create partitions 01
328 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
329 node_name: {{ HOSTNAME_CTL01 }}
330 retry: {count: 1, delay: 30}
331 skip_fail: false
332
333- description: Create partitions 02
334 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
335 node_name: {{ HOSTNAME_CTL02 }}
336 retry: {count: 1, delay: 30}
337 skip_fail: false
338
339- description: Create partitions 03
340 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
341 node_name: {{ HOSTNAME_CTL03 }}
342 retry: {count: 1, delay: 30}
343 skip_fail: false
344
345- description: create volume_group
346 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
347 node_name: {{ HOSTNAME_CFG01 }}
348 retry: {count: 1, delay: 30}
349 skip_fail: false
350
351- description: Install cinder-volume
352 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
353 node_name: {{ HOSTNAME_CFG01 }}
354 retry: {count: 1, delay: 30}
355 skip_fail: false
356
357- description: Install crudini
358 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
359 node_name: {{ HOSTNAME_CFG01 }}
360 retry: {count: 1, delay: 30}
361 skip_fail: false
362
363- description: Temporary WR set enabled backends value 01
364 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
365 node_name: {{ HOSTNAME_CTL01 }}
366 retry: {count: 1, delay: 30}
367 skip_fail: false
368
369- description: Temporary WR set enabled backends value 02
370 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
371 node_name: {{ HOSTNAME_CTL02 }}
372 retry: {count: 1, delay: 30}
373 skip_fail: false
374
375- description: Temporary WR set enabled backends value 03
376 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
377 node_name: {{ HOSTNAME_CTL03 }}
378 retry: {count: 1, delay: 30}
379 skip_fail: false
380
381- description: Install docker.io on gtw
382 cmd: salt-call cmd.run 'apt-get install docker.io -y'
383 node_name: {{ HOSTNAME_GTW01 }}
384 retry: {count: 1, delay: 30}
385 skip_fail: false
386
Tatyana Leontovichd6bcbc92018-03-23 15:02:28 +0200387- description: Enable forward policy
388 cmd: iptables --policy FORWARD ACCEPT
389 node_name: {{ HOSTNAME_GTW01 }}
390 retry: {count: 1, delay: 30}
391 skip_fail: false
392
Tatyana Leontovichc447b122018-02-22 12:30:42 +0200393- description: Restart cinder volume
394 cmd: |
395 salt -C 'I@cinder:controller' service.restart cinder-volume;
396 node_name: {{ HOSTNAME_CFG01 }}
397 retry: {count: 2, delay: 5}
398 skip_fail: false
399
400- description: create rc file on cfg
401 cmd: scp ctl01:/root/keystonercv3 /root
402 node_name: {{ HOSTNAME_CFG01 }}
403 retry: {count: 1, delay: 30}
404 skip_fail: false
405
406- description: Copy rc file
407 cmd: scp /root/keystonercv3 gtw01:/root
408 node_name: {{ HOSTNAME_CFG01 }}
409 retry: {count: 1, delay: 30}
410 skip_fail: false
sgudz3fd44542018-04-02 11:45:49 +0300411
412- description: Install manila-api on first node
413 cmd: |
414 salt -C 'I@manila:api and *01*' state.sls manila.api;
415 node_name: {{ HOSTNAME_CFG01 }}
416 retry: {count: 1, delay: 5}
417 skip_fail: false
418
419- description: Install manila-api on other nodes
420 cmd: |
421 salt -C 'I@manila:api and not *01*' state.sls manila.api;
422 node_name: {{ HOSTNAME_CFG01 }}
423 retry: {count: 1, delay: 5}
424 skip_fail: false
425
426- description: Install manila-scheduler
427 cmd: |
428 salt -C 'I@manila:scheduler' state.sls manila.scheduler;
429 node_name: {{ HOSTNAME_CFG01 }}
430 retry: {count: 1, delay: 5}
431 skip_fail: false
432
433- description: Install manila-share
434 cmd: |
435 salt -C 'I@manila:share' state.sls manila.share;
436 node_name: {{ HOSTNAME_CFG01 }}
437 retry: {count: 1, delay: 5}
438 skip_fail: false
439
Tatyana Leontovich3cc1c132018-04-03 00:41:17 +0300440- description: WR https://mirantis.jira.com/browse/PROD-19012
441 cmd: |
Tatyana Leontovich1618a2a2018-04-03 10:19:25 +0300442 salt 'ctl*' cmd.run 'systemctl restart apache2'
Tatyana Leontovich3cc1c132018-04-03 00:41:17 +0300443 node_name: {{ HOSTNAME_CFG01 }}
444 retry: {count: 1, delay: 5}
445 skip_fail: false
446
sgudz3fd44542018-04-02 11:45:49 +0300447- description: Check manila-services
448 cmd: |
449 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila service-list'
450 node_name: {{ HOSTNAME_CFG01 }}
Tatyana Leontovich1618a2a2018-04-03 10:19:25 +0300451 retry: {count: 3, delay: 15}
sgudz3fd44542018-04-02 11:45:49 +0300452 skip_fail: false
453
454- description: Create manila type
455 cmd: |
sgudz1d658402018-04-06 11:59:48 +0300456 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 +0300457 node_name: {{ HOSTNAME_CFG01 }}
458 retry: {count: 1, delay: 5}
459 skip_fail: false
460
461- description: Create CIFS and NFS share and check it status
462 cmd: |
463 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create CIFS 1 --share-type=default';
464 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create NFS 1 --share-type=default';
465 sleep 5;
466 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila list';
467 node_name: {{ HOSTNAME_CFG01 }}
468 retry: {count: 1, delay: 5}
469 skip_fail: false
Oleksii Butenkoc05c9f62018-04-19 19:00:02 +0300470
471{{ SHARED.RUN_NEW_TEMPEST() }}