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