blob: 043b74afbf9c23326472833bb9bce62fa3435b8d [file] [log] [blame]
Tatyana Leontovichecd491d2017-09-13 13:51:12 +03001{% from 'mcp-ocata-local-repo-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'mcp-ocata-local-repo-dvr/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'mcp-ocata-local-repo-dvr/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'mcp-ocata-local-repo-dvr/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'mcp-ocata-local-repo-dvr/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 PATTERN = os_env('PATTERN', 'smoke') %}
9{% set LAB_CONFIG_NAME = os_env('LAB_CONFIG_NAME') %}
10
11# Install OpenStack control services
12
13- description: Upload policy override
14 upload:
15 local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/
16 local_filename: overrides-policy.yml
17 remote_path: /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/
18 node_name: {{ HOSTNAME_CFG01 }}
19
20- description: Create custom cluster control class
21 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
22 node_name: {{ HOSTNAME_CFG01 }}
23
24- description: Rename control classes
25 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 &&
26 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 &&
27 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all &&
28 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar
29 node_name: {{ HOSTNAME_CFG01 }}
30
31- description: Install glance on all controllers
32 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
33 -C 'I@glance:server' state.sls glance -b 1
34 node_name: {{ HOSTNAME_CFG01 }}
35 retry: {count: 1, delay: 5}
36 skip_fail: false
37
38- description: Install keystone service (note that different fernet keys are created on different nodes)
39 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
40 -C 'I@keystone:server' state.sls keystone.server -b 1
41 node_name: {{ HOSTNAME_CFG01 }}
42 retry: {count: 2, delay: 15}
43 skip_fail: false
44
45- description: Restart apache due to PROD-10477
46 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 15}
49 skip_fail: false
50
51- description: Check apache status to PROD-10477
52 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
53 node_name: {{ HOSTNAME_CFG01 }}
54 retry: {count: 1, delay: 15}
55 skip_fail: false
56
57- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
58 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
59 -C 'I@glance:server' state.sls glusterfs.client
60 node_name: {{ HOSTNAME_CFG01 }}
61 retry: {count: 1, delay: 5}
62 skip_fail: false
63
64- description: Update fernet keys for keystone server on the mounted glusterfs volume
65 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
66 -C 'I@keystone:server' state.sls keystone.server -b 1
67 node_name: {{ HOSTNAME_CFG01 }}
68 retry: {count: 1, delay: 5}
69 skip_fail: false
70
71- description: Populate keystone services/tenants/admins
72 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
73 -C 'I@keystone:client' state.sls keystone.client
74 node_name: {{ HOSTNAME_CFG01 }}
Dennis Dmitrievf073e6f2018-02-06 23:45:15 +020075 retry: {count: 2, delay: 5}
Tatyana Leontovichecd491d2017-09-13 13:51:12 +030076 skip_fail: false
77
78- description: Check keystone service-list
79 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovichb1488692017-11-22 18:39:51 +020080 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
Tatyana Leontovichecd491d2017-09-13 13:51:12 +030081 node_name: {{ HOSTNAME_CFG01 }}
82 retry: {count: 1, delay: 5}
83 skip_fail: false
84
85- description: Check glance image-list
86 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
87 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
88 node_name: {{ HOSTNAME_CFG01 }}
89 retry: {count: 1, delay: 5}
90 skip_fail: false
91
92
93- description: Install nova on all controllers
94 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
95 -C 'I@nova:controller' state.sls nova -b 1
96 node_name: {{ HOSTNAME_CFG01 }}
97 retry: {count: 2, delay: 5}
98 skip_fail: false
99
100- description: Check nova service-list
101 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
102 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
103 node_name: {{ HOSTNAME_CFG01 }}
104 retry: {count: 3, delay: 5}
105 skip_fail: false
106
107
108- description: Install cinder
109 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
110 -C 'I@cinder:controller' state.sls cinder -b 1
111 node_name: {{ HOSTNAME_CFG01 }}
112 retry: {count: 1, delay: 5}
113 skip_fail: false
114
115- description: Check cinder list
116 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
117 -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
118 node_name: {{ HOSTNAME_CFG01 }}
119 retry: {count: 1, delay: 5}
120 skip_fail: false
121
122
123- description: Install neutron service
124 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
125 -C 'I@neutron:server' state.sls neutron -b 1
126 node_name: {{ HOSTNAME_CFG01 }}
127 retry: {count: 1, delay: 5}
128 skip_fail: false
129
130- description: Install neutron on gtw node
131 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
132 -C 'I@neutron:gateway' state.sls neutron
133 node_name: {{ HOSTNAME_CFG01 }}
134 retry: {count: 1, delay: 5}
135 skip_fail: false
136
137# isntall designate
138- description: Install powerdns
139 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
140 -C 'ctl*' state.sls powerdns
141 node_name: {{ HOSTNAME_CFG01 }}
142 retry: {count: 1, delay: 5}
143 skip_fail: false
144
145- description: Install designate
146 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
147 -C 'I@designate:server' state.sls designate -b 1
148 node_name: {{ HOSTNAME_CFG01 }}
149 retry: {count: 5, delay: 10}
150 skip_fail: false
151
152- description: Check neutron agent-list
153 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
154 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
155 node_name: {{ HOSTNAME_CFG01 }}
156 retry: {count: 1, delay: 5}
157 skip_fail: false
158
159- description: Install heat service
160 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
161 -C 'I@heat:server' state.sls heat -b 1
162 node_name: {{ HOSTNAME_CFG01 }}
163 retry: {count: 1, delay: 5}
164 skip_fail: false
165
166- description: Check heat service
167 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovichb1488692017-11-22 18:39:51 +0200168 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
Tatyana Leontovichecd491d2017-09-13 13:51:12 +0300169 node_name: {{ HOSTNAME_CFG01 }}
170 retry: {count: 5, delay: 10}
171 skip_fail: false
172
173
174- description: Deploy horizon dashboard
175 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
176 -C 'I@horizon:server' state.sls horizon
177 node_name: {{ HOSTNAME_CFG01 }}
178 retry: {count: 1, delay: 5}
179 skip_fail: true
180
181- description: Deploy nginx proxy
182 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
183 -C 'I@nginx:server' state.sls nginx
184 node_name: {{ HOSTNAME_CFG01 }}
185 retry: {count: 1, delay: 5}
186 skip_fail: true
187
188
189# Install compute node
190
191- description: Apply formulas for compute node
192 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
193 node_name: {{ HOSTNAME_CFG01 }}
194 retry: {count: 1, delay: 5}
195 skip_fail: true
196
197- description: Re-apply(as in doc) formulas for compute node
198 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
199 node_name: {{ HOSTNAME_CFG01 }}
200 retry: {count: 1, delay: 5}
Oleksii Butenko9f2601c2018-02-08 15:13:21 +0200201 skip_fail: false
Tatyana Leontovichecd491d2017-09-13 13:51:12 +0300202
203- description: Check IP on computes
204 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
205 'ip a'
206 node_name: {{ HOSTNAME_CFG01 }}
207 retry: {count: 10, delay: 30}
208 skip_fail: false
209
210
211 # Upload cirros image
212
213- description: Upload cirros image on ctl01
214 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
215 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
216 node_name: {{ HOSTNAME_CFG01 }}
217 retry: {count: 2, delay: 30}
218 skip_fail: false
219
220- description: Register image in glance
221 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
Dmitry Tyzhnenko30f58042017-11-28 17:00:40 +0200222 '. /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'
Tatyana Leontovichecd491d2017-09-13 13:51:12 +0300223 node_name: {{ HOSTNAME_CFG01 }}
224 retry: {count: 1, delay: 30}
225 skip_fail: false
226
227- description: Create net04_external
228 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
229 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
230 node_name: {{ HOSTNAME_CFG01 }}
231 retry: {count: 1, delay: 30}
232 skip_fail: false
233
234- description: Create subnet_external
235 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
236 '. /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'
237 node_name: {{ HOSTNAME_CFG01 }}
238 retry: {count: 1, delay: 30}
239 skip_fail: false
240
241- description: Create net04
242 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
243 '. /root/keystonercv3; neutron net-create net04'
244 node_name: {{ HOSTNAME_CFG01 }}
245 retry: {count: 1, delay: 30}
246 skip_fail: false
247
248- description: Create subnet_net04
249 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
250 '. /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'
251 node_name: {{ HOSTNAME_CFG01 }}
252 retry: {count: 1, delay: 30}
253 skip_fail: false
254
255- description: Create router
256 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
257 '. /root/keystonercv3; neutron router-create net04_router01'
258 node_name: {{ HOSTNAME_CFG01 }}
259 retry: {count: 1, delay: 30}
260 skip_fail: false
261
262- description: Set geteway
263 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
264 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
265 node_name: {{ HOSTNAME_CFG01 }}
266 retry: {count: 1, delay: 30}
267 skip_fail: false
268
269- description: Add interface
270 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
271 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
272 node_name: {{ HOSTNAME_CFG01 }}
273 retry: {count: 1, delay: 30}
274 skip_fail: false
275
276- description: Allow all tcp
277 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
278 '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
279 node_name: {{ HOSTNAME_CFG01 }}
280 retry: {count: 1, delay: 30}
281 skip_fail: false
282
283- description: Allow all icmp
284 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
285 '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
286 node_name: {{ HOSTNAME_CFG01 }}
287 retry: {count: 1, delay: 30}
288 skip_fail: false
289
290- description: sync time
291 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
292 'service ntp stop; ntpd -gq; service ntp start'
293 node_name: {{ HOSTNAME_CFG01 }}
294 retry: {count: 1, delay: 30}
295 skip_fail: false
296
297# Configure cinder-volume salt-call PROD-13167
298- description: Set disks 01
299 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
300 node_name: {{ HOSTNAME_CTL01 }}
301 retry: {count: 1, delay: 30}
302 skip_fail: false
303
304- description: Set disks 02
305 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
306 node_name: {{ HOSTNAME_CTL02 }}
307 retry: {count: 1, delay: 30}
308 skip_fail: false
309
310- description: Set disks 03
311 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
312 node_name: {{ HOSTNAME_CTL03 }}
313 retry: {count: 1, delay: 30}
314 skip_fail: false
315
316- description: Create partitions 01
317 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
318 node_name: {{ HOSTNAME_CTL01 }}
319 retry: {count: 1, delay: 30}
320 skip_fail: false
321
322- description: Create partitions 02
323 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
324 node_name: {{ HOSTNAME_CTL01 }}
325 retry: {count: 1, delay: 30}
326 skip_fail: false
327
328- description: Create partitions 03
329 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
330 node_name: {{ HOSTNAME_CTL01 }}
331 retry: {count: 1, delay: 30}
332 skip_fail: false
333
334- description: create volume_group
335 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
336 node_name: {{ HOSTNAME_CFG01 }}
337 retry: {count: 1, delay: 30}
338 skip_fail: false
339
340- description: Install cinder-volume
341 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
342 node_name: {{ HOSTNAME_CFG01 }}
343 retry: {count: 1, delay: 30}
344 skip_fail: false
345
346- description: Install crudini
347 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
348 node_name: {{ HOSTNAME_CFG01 }}
349 retry: {count: 1, delay: 30}
350 skip_fail: false
351
352- description: Temporary WR set enabled backends value 01
353 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
354 node_name: {{ HOSTNAME_CTL01 }}
355 retry: {count: 1, delay: 30}
356 skip_fail: false
357
358- description: Temporary WR set enabled backends value 02
359 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
360 node_name: {{ HOSTNAME_CTL02 }}
361 retry: {count: 1, delay: 30}
362 skip_fail: false
363
364- description: Temporary WR set enabled backends value 03
365 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
366 node_name: {{ HOSTNAME_CTL03 }}
367 retry: {count: 1, delay: 30}
368 skip_fail: false
369
370- description: Install docker.io on gtw
371 cmd: salt-call cmd.run 'apt-get install docker.io -y'
372 node_name: {{ HOSTNAME_GTW01 }}
373 retry: {count: 1, delay: 30}
374 skip_fail: false
375
Tatyana Leontovichd6bcbc92018-03-23 15:02:28 +0200376- description: Enable forward policy
377 cmd: iptables --policy FORWARD ACCEPT
Dennis Dmitrievc8c2fde2018-03-24 17:02:35 +0200378 node_name: {{ HOSTNAME_GTW01 }}
Tatyana Leontovichd6bcbc92018-03-23 15:02:28 +0200379 retry: {count: 1, delay: 30}
380 skip_fail: false
381
Tatyana Leontovichecd491d2017-09-13 13:51:12 +0300382- description: create rc file on cfg
383 cmd: scp ctl01:/root/keystonercv3 /root
384 node_name: {{ HOSTNAME_CFG01 }}
385 retry: {count: 1, delay: 30}
386 skip_fail: false
387
388- description: Copy rc file
389 cmd: scp /root/keystonercv3 gtw01:/root
390 node_name: {{ HOSTNAME_CFG01 }}
391 retry: {count: 1, delay: 30}
392 skip_fail: false
393
394- description: Run tests
395 cmd: |
396 if [[ {{ PATTERN }} == "false" ]]; then
397 salt-call cmd.run 'docker run --rm --net=host -e TEMPEST_CONF=lvm_mcp.conf -e SKIP_LIST=mcp_skip.list -e SOURCE_FILE=keystonercv3 -v /root/:/home/rally docker-sandbox.sandbox.mirantis.net/rally-tempest/rally-tempest:with_designate >> image.output'
398 else
399 salt-call cmd.run "docker run --rm --net=host -e TEMPEST_CONF=lvm_mcp.conf -e SKIP_LIST=mcp_skip.list -e SOURCE_FILE=keystonercv3 -e CUSTOM='--pattern {{ PATTERN }}' -v /root/:/home/rally docker-sandbox.sandbox.mirantis.net/rally-tempest/rally-tempest:with_designate >> image.output"
400 fi
401 node_name: {{ HOSTNAME_GTW01 }}
402 retry: {count: 1, delay: 5}
403 skip_fail: false
404
405- description: Download xml results
406 download:
407 remote_path: /root
408 remote_filename: "report_*.xml"
409 local_path: {{ os_env('PWD') }}
410 node_name: {{ HOSTNAME_GTW01 }}
411 skip_fail: true
412
413- description: Download html results
414 download:
415 remote_path: /root
416 remote_filename: "report_*.html"
417 local_path: {{ os_env('PWD') }}
418 node_name: {{ HOSTNAME_GTW01 }}
419 skip_fail: true