blob: 9b7061d4afe01a83145fb779be2d221d28245b84 [file] [log] [blame]
Dennis Dmitrievab83ea42017-05-12 16:52:45 +03001{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %}
Tatyana Leontovich6238ba52017-06-22 19:31:56 +03002{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CTL03 with context %}
Tatyana Leontovich7c97e802017-07-19 17:08:39 +03005{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_GTW01 with context %}
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +03006{% from 'virtual-mcp-ocata-dvr/salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
7{% from 'virtual-mcp-ocata-dvr/salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
Tatyana Leontovichf51eb2e2017-07-25 17:39:27 +03008{% set PATTERN = os_env('PATTERN', 'smoke') %}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +03009
10# Install OpenStack control services
11
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030012- 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)
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030020 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 }}
Tatyana Leontovichd4f1fd32017-04-21 13:31:44 +030023 retry: {count: 2, delay: 15}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030024 skip_fail: false
25
Tatyana Leontovichfa7ae4d2017-04-25 13:46:14 +030026- 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
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030038- 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
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030052- 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
Tatyana Leontovichb8b02d82017-04-21 14:07:33 +030061 -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack service list'
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030062 node_name: {{ HOSTNAME_CFG01 }}
63 retry: {count: 1, delay: 5}
64 skip_fail: false
65
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030066- 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 }}
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030078 retry: {count: 2, delay: 5}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030079 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 service-list'
84 node_name: {{ HOSTNAME_CFG01 }}
85 retry: {count: 1, 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: false
110
111- description: Install neutron on gtw node
112 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
113 -C 'I@neutron:gateway' state.sls neutron
114 node_name: {{ HOSTNAME_CFG01 }}
115 retry: {count: 1, delay: 5}
116 skip_fail: false
117
Tatyana Leontovichc33be1f2017-07-19 17:38:30 +0300118# isntall designate
119- description: Install powerdns
120 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
121 -C 'ctl*' state.sls powerdns
122 node_name: {{ HOSTNAME_CFG01 }}
123 retry: {count: 1, delay: 5}
124 skip_fail: false
125
126- description: Install designate
127 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
128 -C 'I@designate:server' state.sls designate -b 1
129 node_name: {{ HOSTNAME_CFG01 }}
130 retry: {count: 5, delay: 10}
131 skip_fail: false
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300132
133- description: Check neutron agent-list
134 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
135 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
136 node_name: {{ HOSTNAME_CFG01 }}
137 retry: {count: 1, delay: 5}
138 skip_fail: false
139
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300140- description: Install heat service
141 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
142 -C 'I@heat:server' state.sls heat -b 1
143 node_name: {{ HOSTNAME_CFG01 }}
144 retry: {count: 1, delay: 5}
145 skip_fail: false
146
147- description: Check heat service
148 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Igor Yozhikov8ec6d2f2017-05-23 16:17:29 +0300149 -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack orchestration resource type list'
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300150 node_name: {{ HOSTNAME_CFG01 }}
Igor Yozhikov8ec6d2f2017-05-23 16:17:29 +0300151 retry: {count: 5, delay: 10}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300152 skip_fail: false
153
154
155- description: Deploy horizon dashboard
156 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
157 -C 'I@horizon:server' state.sls horizon
158 node_name: {{ HOSTNAME_CFG01 }}
159 retry: {count: 1, delay: 5}
160 skip_fail: true
161
162- description: Deploy nginx proxy
163 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
164 -C 'I@nginx:server' state.sls nginx
165 node_name: {{ HOSTNAME_CFG01 }}
166 retry: {count: 1, delay: 5}
167 skip_fail: true
168
169
170# Install compute node
171
172- description: Apply formulas for compute node
173 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
174 node_name: {{ HOSTNAME_CFG01 }}
175 retry: {count: 1, delay: 5}
176 skip_fail: true
177
178- description: Re-apply(as in doc) formulas for compute node
179 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
180 node_name: {{ HOSTNAME_CFG01 }}
181 retry: {count: 1, delay: 5}
182 skip_fail: true
183
184- description: Check IP on computes
185 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
186 'ip a'
187 node_name: {{ HOSTNAME_CFG01 }}
188 retry: {count: 10, delay: 30}
189 skip_fail: false
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300190
191
192 # Upload cirros image
193
194- description: Upload cirros image on ctl01
195 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
196 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
197 node_name: {{ HOSTNAME_CFG01 }}
198 retry: {count: 2, delay: 30}
199 skip_fail: false
200
201- description: Register image in glance
202 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
203 '. /root/keystonercv3; glance image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-0.3.4-i386-disk.img'
204 node_name: {{ HOSTNAME_CFG01 }}
205 retry: {count: 1, delay: 30}
206 skip_fail: false
207
208- description: Create net04_external
209 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
Tatyana Leontovich674abf82017-07-20 15:44:15 +0300210 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300211 node_name: {{ HOSTNAME_CFG01 }}
212 retry: {count: 1, delay: 30}
213 skip_fail: false
214
215- description: Create subnet_external
216 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
217 '. /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'
218 node_name: {{ HOSTNAME_CFG01 }}
219 retry: {count: 1, delay: 30}
220 skip_fail: false
221
222- description: Create net04
223 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
224 '. /root/keystonercv3; neutron net-create net04'
225 node_name: {{ HOSTNAME_CFG01 }}
226 retry: {count: 1, delay: 30}
227 skip_fail: false
228
229- description: Create subnet_net04
230 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
231 '. /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'
232 node_name: {{ HOSTNAME_CFG01 }}
233 retry: {count: 1, delay: 30}
234 skip_fail: false
235
236- description: Create router
237 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
238 '. /root/keystonercv3; neutron router-create net04_router01'
239 node_name: {{ HOSTNAME_CFG01 }}
240 retry: {count: 1, delay: 30}
241 skip_fail: false
242
243- description: Set geteway
244 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
245 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
246 node_name: {{ HOSTNAME_CFG01 }}
247 retry: {count: 1, delay: 30}
248 skip_fail: false
249
250- description: Add interface
251 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
252 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
253 node_name: {{ HOSTNAME_CFG01 }}
254 retry: {count: 1, delay: 30}
255 skip_fail: false
256
257- description: Allow all tcp
258 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
259 '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
260 node_name: {{ HOSTNAME_CFG01 }}
261 retry: {count: 1, delay: 30}
262 skip_fail: false
263
264- description: Allow all icmp
265 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
266 '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
267 node_name: {{ HOSTNAME_CFG01 }}
268 retry: {count: 1, delay: 30}
269 skip_fail: false
270
Tatyana Leontovichfa31b392017-07-24 18:37:41 +0300271- description: sync time
272 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
273 'service ntp stop; ntpd -gq; service ntp start'
274 node_name: {{ HOSTNAME_CFG01 }}
275 retry: {count: 1, delay: 30}
276 skip_fail: false
277
278- description: Temp workaround of PROD-13167
Tatyana Leontovich397a8ba2017-07-25 02:34:46 +0300279 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run
Tatyana Leontovichfa31b392017-07-24 18:37:41 +0300280 'apt-get install python-pymysql -y'
281 node_name: {{ HOSTNAME_CFG01 }}
282 retry: {count: 1, delay: 30}
283 skip_fail: false
284
285# Configure cinder-volume salt-call PROD-13167
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300286- description: Set disks 01
287 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
288 node_name: {{ HOSTNAME_CTL01 }}
289 retry: {count: 1, delay: 30}
290 skip_fail: false
291
292- description: Set disks 02
293 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
294 node_name: {{ HOSTNAME_CTL02 }}
295 retry: {count: 1, delay: 30}
296 skip_fail: false
297
298- description: Set disks 03
299 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
300 node_name: {{ HOSTNAME_CTL03 }}
301 retry: {count: 1, delay: 30}
302 skip_fail: false
303
304- description: Create partitions 01
305 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
306 node_name: {{ HOSTNAME_CTL01 }}
307 retry: {count: 1, delay: 30}
308 skip_fail: false
309
310- description: Create partitions 02
311 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
312 node_name: {{ HOSTNAME_CTL01 }}
313 retry: {count: 1, delay: 30}
314 skip_fail: false
315
316- description: Create partitions 03
317 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
318 node_name: {{ HOSTNAME_CTL01 }}
319 retry: {count: 1, delay: 30}
Tatyana Leontovich7c97e802017-07-19 17:08:39 +0300320 skip_fail: false
321
322- description: create volume_group
323 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
324 node_name: {{ HOSTNAME_CFG01 }}
325 retry: {count: 1, delay: 30}
326 skip_fail: false
327
328- description: Install cinder-volume
329 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
330 node_name: {{ HOSTNAME_CFG01 }}
331 retry: {count: 1, delay: 30}
332 skip_fail: false
333
334- description: Install crudini
335 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
336 node_name: {{ HOSTNAME_CFG01 }}
337 retry: {count: 1, delay: 30}
338 skip_fail: false
339
340- description: Temporary WR set enabled backends value 01
341 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
342 node_name: {{ HOSTNAME_CTL01 }}
343 retry: {count: 1, delay: 30}
344 skip_fail: false
345
346- description: Temporary WR set enabled backends value 02
347 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
348 node_name: {{ HOSTNAME_CTL02 }}
349 retry: {count: 1, delay: 30}
350 skip_fail: false
351
352- description: Temporary WR set enabled backends value 03
353 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
354 node_name: {{ HOSTNAME_CTL03 }}
355 retry: {count: 1, delay: 30}
356 skip_fail: false
357
358- description: Install docker.io on gtw
359 cmd: salt-call cmd.run 'apt-get install docker.io -y'
360 node_name: {{ HOSTNAME_GTW01 }}
361 retry: {count: 1, delay: 30}
362 skip_fail: false
363
364- description: create rc file on cfg
365 cmd: scp ctl01:/root/keystonercv3 /root
366 node_name: {{ HOSTNAME_CFG01 }}
367 retry: {count: 1, delay: 30}
368 skip_fail: false
369
370- description: Copy rc file
371 cmd: scp /root/keystonercv3 gtw01:/root
372 node_name: {{ HOSTNAME_CFG01 }}
373 retry: {count: 1, delay: 30}
374 skip_fail: false
375
376- description: Run tests
Tatyana Leontovich07bc6ed2017-07-25 13:26:48 +0300377 cmd: |
Tatyana Leontovichf51eb2e2017-07-25 17:39:27 +0300378 pattern={{ PATTERN }};
Tatyana Leontovich6c61db32017-07-26 12:34:41 +0300379 if [[ "$pattern" == "false" ]]; then
Tatyana Leontovich07bc6ed2017-07-25 13:26:48 +0300380 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'
Tatyana Leontovich6c61db32017-07-26 12:34:41 +0300381 else
382 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'
Tatyana Leontovich07bc6ed2017-07-25 13:26:48 +0300383 fi
Tatyana Leontoviche3ecb5e2017-07-25 19:29:41 +0300384 node_name: {{ HOSTNAME_GTW01 }}
Tatyana Leontovich07bc6ed2017-07-25 13:26:48 +0300385 retry: {count: 1, delay: 5}
Tatyana Leontovich7c97e802017-07-19 17:08:39 +0300386 skip_fail: false
Dennis Dmitriev2dfb8ef2017-07-21 20:19:38 +0300387
388- description: Download results
389 download:
390 remote_path: /root
391 remote_filename: "report_*.xml"
392 local_path: {{ os_env('PWD') }}
393 node_name: {{ HOSTNAME_GTW01 }}
394 skip_fail: false