blob: 47f68dc7a78f97b2dbba19fbab386885c7f80688 [file] [log] [blame]
sgudz8c888ec2017-10-02 15:29:23 +03001{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
sgudz8c888ec2017-10-02 15:29:23 +03002{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_GTW01 with context %}
3{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
4{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
sgudzcced67d2017-10-11 15:56:09 +03005{% set PATTERN = os_env('PATTERN', 'false') %}
6{% set RUN_TEMPEST = os_env('RUN_TEMPEST', 'false') %}
sgudz8c888ec2017-10-02 15:29:23 +03007# Install OpenStack control services
8
9- description: Install glance on all controllers
10 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
11 -C 'I@glance:server' state.sls glance -b 1
12 node_name: {{ HOSTNAME_CFG01 }}
13 retry: {count: 1, delay: 5}
14 skip_fail: false
15
16- description: Install keystone service (note that different fernet keys are created on different nodes)
17 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
18 -C 'I@keystone:server' state.sls keystone.server -b 1
19 node_name: {{ HOSTNAME_CFG01 }}
20 retry: {count: 2, delay: 15}
21 skip_fail: false
22
23- description: Restart apache due to PROD-10477
24 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
25 node_name: {{ HOSTNAME_CFG01 }}
26 retry: {count: 1, delay: 15}
27 skip_fail: false
28
29- description: Check apache status to PROD-10477
30 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
31 node_name: {{ HOSTNAME_CFG01 }}
32 retry: {count: 1, delay: 15}
33 skip_fail: false
34
35- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
36 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
37 -C 'I@glance:server' state.sls glusterfs.client
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 5}
40 skip_fail: false
41
42- description: Update fernet keys for keystone server on the mounted glusterfs volume
43 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
44 -C 'I@keystone:server' state.sls keystone.server -b 1
45 node_name: {{ HOSTNAME_CFG01 }}
46 retry: {count: 1, delay: 5}
47 skip_fail: false
48
49- description: Populate keystone services/tenants/admins
50 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
51 -C 'I@keystone:client' state.sls keystone.client
52 node_name: {{ HOSTNAME_CFG01 }}
Dennis Dmitrievf073e6f2018-02-06 23:45:15 +020053 retry: {count: 2, delay: 5}
sgudz8c888ec2017-10-02 15:29:23 +030054 skip_fail: false
55
56- description: Check keystone service-list
57 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
58 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
59 node_name: {{ HOSTNAME_CFG01 }}
60 retry: {count: 1, delay: 5}
61 skip_fail: false
62
63- description: Check glance image-list
64 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
65 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
66 node_name: {{ HOSTNAME_CFG01 }}
67 retry: {count: 1, delay: 5}
68 skip_fail: false
69
70
71- description: Install nova on all controllers
72 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
73 -C 'I@nova:controller' state.sls nova -b 1
74 node_name: {{ HOSTNAME_CFG01 }}
75 retry: {count: 2, delay: 5}
76 skip_fail: false
77
78- description: Check nova service-list
79 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
80 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
81 node_name: {{ HOSTNAME_CFG01 }}
82 retry: {count: 3, delay: 5}
83 skip_fail: false
84
85
86- description: Install cinder
87 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
88 -C 'I@cinder:controller' state.sls cinder -b 1
89 node_name: {{ HOSTNAME_CFG01 }}
90 retry: {count: 1, delay: 5}
91 skip_fail: false
92
sgudzcced67d2017-10-11 15:56:09 +030093- description: Install cinder volume
94 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
95 -C 'I@cinder:volume' state.sls cinder
96 node_name: {{ HOSTNAME_CFG01 }}
97 retry: {count: 1, delay: 5}
98 skip_fail: false
99
sgudz8c888ec2017-10-02 15:29:23 +0300100- description: Check cinder list
101 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
102 -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
103 node_name: {{ HOSTNAME_CFG01 }}
104 retry: {count: 1, delay: 5}
105 skip_fail: false
106
107
108- description: Install neutron service
109 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
110 -C 'I@neutron:server' state.sls neutron -b 1
111 node_name: {{ HOSTNAME_CFG01 }}
112 retry: {count: 1, delay: 5}
113 skip_fail: true
114
115# install contrail
116- description: Install contrail db
117 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
118 -C 'I@opencontrail:database' state.sls opencontrail.database
119 node_name: {{ HOSTNAME_CFG01 }}
120 retry: {count: 2, delay: 20}
121 skip_fail: false
122
123- description: Install contrail on 1st node and skip client part
124 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
125 -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client
126 node_name: {{ HOSTNAME_CFG01 }}
127 retry: {count: 3, delay: 5}
128 skip_fail: false
129
sgudzcced67d2017-10-11 15:56:09 +0300130- description: Configure contrail
131 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
132 -C 'I@opencontrail:collector' state.sls opencontrail.collector
133 node_name: {{ HOSTNAME_CFG01 }}
134 retry: {count: 1, delay: 5}
135 skip_fail: false
136
sgudz8c888ec2017-10-02 15:29:23 +0300137- description: Install contrail on all nodes still skipping client
138 cmd: salt --hard-crash --state-output=mixed --state-verbose=Falsa
139 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
140 node_name: {{ HOSTNAME_CFG01 }}
141 retry: {count: 2, delay: 5}
142 skip_fail: false
143
sgudzcced67d2017-10-11 15:56:09 +0300144- description: Check contrail status
145 cmd: sleep 30; salt --hard-crash --state-output=mixed --state-verbose=False
146 -C 'I@opencontrail:control' cmd.run contrail-status
147 node_name: {{ HOSTNAME_CFG01 }}
148 retry: {count: 1, delay: 5}
149 skip_fail: false
150
151- description: Install contrail and do client part as well (count and delay for waiting for collector connection)
sgudz8c888ec2017-10-02 15:29:23 +0300152 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
153 -C 'I@opencontrail:control' state.sls opencontrail
154 node_name: {{ HOSTNAME_CFG01 }}
sgudzcced67d2017-10-11 15:56:09 +0300155 retry: {count: 5, delay: 60}
sgudz8c888ec2017-10-02 15:29:23 +0300156 skip_fail: false
157
158- description: Configure contrail
159 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
160 -C 'I@opencontrail:database:id:1' state.sls opencontrail.client
161 node_name: {{ HOSTNAME_CFG01 }}
sgudzcced67d2017-10-11 15:56:09 +0300162 retry: {count: 2, delay: 5}
sgudz8c888ec2017-10-02 15:29:23 +0300163 skip_fail: false
164
165- description: Check contrail status
sgudzcced67d2017-10-11 15:56:09 +0300166 cmd: sleep 30; salt --hard-crash --state-output=mixed --state-verbose=False
sgudz8c888ec2017-10-02 15:29:23 +0300167 -C 'I@opencontrail:control' cmd.run contrail-status
168 node_name: {{ HOSTNAME_CFG01 }}
169 retry: {count: 1, delay: 5}
170 skip_fail: false
171
sgudz8c888ec2017-10-02 15:29:23 +0300172- description: Install heat service
173 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
174 -C 'I@heat:server' state.sls heat -b 1
175 node_name: {{ HOSTNAME_CFG01 }}
176 retry: {count: 1, delay: 5}
177 skip_fail: false
178
179- description: Check heat service
180 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
181 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
182 node_name: {{ HOSTNAME_CFG01 }}
183 retry: {count: 5, delay: 10}
184 skip_fail: false
185
186
187- description: Deploy horizon dashboard
188 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
189 -C 'I@horizon:server' state.sls horizon
190 node_name: {{ HOSTNAME_CFG01 }}
191 retry: {count: 1, delay: 5}
192 skip_fail: true
193
194- description: Deploy nginx proxy
195 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
196 -C 'I@nginx:server' state.sls nginx
197 node_name: {{ HOSTNAME_CFG01 }}
198 retry: {count: 1, delay: 5}
199 skip_fail: true
200
201
202# Install compute node
203
204- description: Apply formulas for compute node
205 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
206 node_name: {{ HOSTNAME_CFG01 }}
207 retry: {count: 1, delay: 5}
208 skip_fail: true
209
210- description: Re-apply(as in doc) formulas for compute node
211 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
212 node_name: {{ HOSTNAME_CFG01 }}
213 retry: {count: 1, delay: 5}
214 skip_fail: true
215
216- description: Check IP on computes
217 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
218 'ip a'
219 node_name: {{ HOSTNAME_CFG01 }}
220 retry: {count: 10, delay: 30}
221 skip_fail: false
222
223
224 # Upload cirros image
225
226- description: Upload cirros image on ctl01
227 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
228 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
229 node_name: {{ HOSTNAME_CFG01 }}
230 retry: {count: 2, delay: 30}
231 skip_fail: false
232
233- description: Register image in glance
234 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
Dmitry Tyzhnenko30f58042017-11-28 17:00:40 +0200235 '. /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'
sgudz8c888ec2017-10-02 15:29:23 +0300236 node_name: {{ HOSTNAME_CFG01 }}
237 retry: {count: 1, delay: 30}
238 skip_fail: false
239
sgudzcced67d2017-10-11 15:56:09 +0300240#- description: Create net04_external
241# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
242# '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
243# node_name: {{ HOSTNAME_CFG01 }}
244# retry: {count: 1, delay: 30}
245# skip_fail: false
sgudz8c888ec2017-10-02 15:29:23 +0300246
sgudzcced67d2017-10-11 15:56:09 +0300247#- description: Create subnet_external
248# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
249# '. /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'
250# node_name: {{ HOSTNAME_CFG01 }}
251# retry: {count: 1, delay: 30}
252# skip_fail: false
sgudz8c888ec2017-10-02 15:29:23 +0300253
254- description: Create net04
255 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
256 '. /root/keystonercv3; neutron net-create net04'
257 node_name: {{ HOSTNAME_CFG01 }}
258 retry: {count: 1, delay: 30}
259 skip_fail: false
260
261- description: Create subnet_net04
262 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
263 '. /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'
264 node_name: {{ HOSTNAME_CFG01 }}
265 retry: {count: 1, delay: 30}
266 skip_fail: false
267
268- description: Create router
269 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
270 '. /root/keystonercv3; neutron router-create net04_router01'
271 node_name: {{ HOSTNAME_CFG01 }}
272 retry: {count: 1, delay: 30}
273 skip_fail: false
274
sgudzcced67d2017-10-11 15:56:09 +0300275#- description: Set geteway
276# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
277# '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
278# node_name: {{ HOSTNAME_CFG01 }}
279# retry: {count: 1, delay: 30}
280# skip_fail: false
sgudz8c888ec2017-10-02 15:29:23 +0300281
282- description: Add interface
283 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
284 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
285 node_name: {{ HOSTNAME_CFG01 }}
286 retry: {count: 1, delay: 30}
287 skip_fail: false
288
289- description: Allow all tcp
290 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
291 '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
292 node_name: {{ HOSTNAME_CFG01 }}
293 retry: {count: 1, delay: 30}
294 skip_fail: false
295
296- description: Allow all icmp
297 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
298 '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
299 node_name: {{ HOSTNAME_CFG01 }}
300 retry: {count: 1, delay: 30}
301 skip_fail: false
302
303- description: sync time
304 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
305 'service ntp stop; ntpd -gq; service ntp start'
306 node_name: {{ HOSTNAME_CFG01 }}
307 retry: {count: 1, delay: 30}
308 skip_fail: false
309
sgudzcced67d2017-10-11 15:56:09 +0300310#- description: Install lvm2 packages
311# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run
312# 'apt-get install python-pymysql lvm2 -y'
313# node_name: {{ HOSTNAME_CFG01 }}
sgudz8c888ec2017-10-02 15:29:23 +0300314# retry: {count: 1, delay: 30}
315# skip_fail: false
316
sgudzcced67d2017-10-11 15:56:09 +0300317#- description: Install crudini
318# cmd: salt -C "cmp*" cmd.run 'apt-get install crudini -y'
319# node_name: {{ HOSTNAME_CFG01 }}
320# retry: {count: 1, delay: 30}
321# skip_fail: true
322
323#- description: Temporary WR set enabled backends value
324# cmd: salt "cmp*" cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
325# node_name: {{ HOSTNAME_CFG01 }}
326# retry: {count: 1, delay: 30}
327# skip_fail: false
328
329#- description: Start cinder-volume service
330# cmd: salt "cmp*" cmd.run '/etc/init.d/cinder-volume stop; /etc/init.d/cinder-volume start;'
331# node_name: {{ HOSTNAME_CFG01 }}
332# retry: {count: 1, delay: 10}
333# skip_fail: true
334
335- description: Install docker.io on ctl
336 cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y'
sgudz8c888ec2017-10-02 15:29:23 +0300337 node_name: {{ HOSTNAME_CFG01 }}
338 retry: {count: 1, delay: 30}
339 skip_fail: false
340
sgudzcced67d2017-10-11 15:56:09 +0300341#- description: create rc file on cfg
342# cmd: scp ctl01:/root/keystonercv3 /root
343# node_name: {{ HOSTNAME_CFG01 }}
344# retry: {count: 1, delay: 30}
345# skip_fail: false
346
sgudz8c888ec2017-10-02 15:29:23 +0300347#- description: Copy rc file
348# cmd: scp /root/keystonercv3 gtw01:/root
349# node_name: {{ HOSTNAME_CFG01 }}
350# retry: {count: 1, delay: 30}
351# skip_fail: false
352
sgudzcced67d2017-10-11 15:56:09 +0300353- description: Hack resolv.conf on VCP nodes for internal services access
354 cmd: |
355 salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not kvm* and not cmp* and not gtw* and not cfg*' cmd.run "echo 'nameserver 172.18.208.44' > /etc/resolv.conf;"
356 salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not kvm* and not cmp* and not gtw* and not cfg*' cmd.run "echo 'nameserver 8.8.8.8' >> /etc/resolv.conf;"
357 node_name: {{ HOSTNAME_CFG01 }}
358 retry: {count: 1, delay: 5}
359 skip_fail: false
sgudz8c888ec2017-10-02 15:29:23 +0300360
sgudzcced67d2017-10-11 15:56:09 +0300361
362- description: Hack vrouter (Delete default moun point)
363 cmd: salt "cmp*" cmd.run "sed -i 's/exit 0//g' /etc/rc.local; echo 'umount /dev/hugepages; service supervisor-vrouter restart' >> /etc/rc.local; echo 'exit 0' >> /etc/rc.local"
364 node_name: {{ HOSTNAME_CFG01 }}
365 retry: {count: 1, delay: 30}
366 skip_fail: true
367
368- description: Temporary WR for correct pci in vrouter.conf
369 cmd: salt "cmp*" cmd.run "sed -i 's/physical\_interface\_address\=.*/physical\_interface\_address=0000\:05\:00\.0/g' /etc/contrail/contrail-vrouter-agent.conf"
370 node_name: {{ HOSTNAME_CFG01 }}
371 retry: {count: 1, delay: 30}
372 skip_fail: true
373
374- description: Remove crashes files from /var/crashes/ while vrouter was crashed
375 cmd: salt "cmp*" cmd.run "rm -rf /var/crashes/*"
376 node_name: {{ HOSTNAME_CFG01 }}
377 retry: {count: 1, delay: 30}
378 skip_fail: true
379
380- description: Reboot computes
381 cmd: salt --timeout=600 "cmp*" system.reboot
382 node_name: {{ HOSTNAME_CFG01 }}
383 retry: {count: 1, delay: 30}
384 skip_fail: true
385
386{%- if RUN_TEMPEST %}
387- description: Run tests
388 cmd: |
389 if [[ {{ PATTERN }} == "false" ]]; then
390 salt "ctl01*" cmd.run "docker run --rm --net=host -e TEMPEST_CONF=lvm_mcp.conf -e SKIP_LIST=mcp_skip.list -e SOURCE_FILE=keystonercv3 -v /etc/ssl/certs/:/etc/ssl/certs/ -v /root/:/home/rally sandriichenko/rally_tempest_docker:mcp1.1_ocata >> image.output"
391 else
392 salt "ctl01*" cmd.run "docker run --rm --net=host -e TEMPEST_CONF=lvm_mcp.conf -e SKIP_LIST=mcp_skip.list -e SOURCE_FILE=keystonercv3 -v /etc/ssl/certs/:/etc/ssl/certs/ -e CUSTOM='--pattern {{ PATTERN }}' -v /root/:/home/rally sandriichenko/rally_tempest_docker:mcp1.1_ocata >> image.output"
393 fi
394 node_name: {{ HOSTNAME_CFG01 }}
395 retry: {count: 1, delay: 5}
396 skip_fail: false
397
398- description: Download xml and html results
399 cmd: |
400 d=$(date +%Y-%m-%d)
401 ctl01_ip=`salt --out=newline_values_only 'ctl01*' grains.get ip4_interfaces:ens2`;
402 scp root@$ctl01_ip:/root/report*.xml /root/report_$d.xml;
403 node_name: {{ HOSTNAME_CFG01 }}
404 retry: {count: 1, delay: 5}
405 skip_fail: true
406{%- endif %}
sgudz8c888ec2017-10-02 15:29:23 +0300407
408#- description: Download html results
409# download:
410# remote_path: /root
411# remote_filename: "report_*.html"
412# local_path: {{ os_env('PWD') }}
sgudzcced67d2017-10-11 15:56:09 +0300413# node_name: {{ HOSTNAME_CFG01 }}
sgudz8c888ec2017-10-02 15:29:23 +0300414# skip_fail: true