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