Repository navigation
Expand file tree
/
Copy pathpost-stack.yaml
More file actions
304 lines (251 loc) · 9.72 KB
/
Copy pathpost-stack.yaml
File metadata and controls
304 lines (251 loc) · 9.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
---
- hosts: 127.0.0.1
connection: local
vars_files:
- zuul-params.yaml
tasks:
- name: Include variables from job_vars/{{ zuul_project | basename }}.yaml
include_vars: "job_vars/{{ zuul_project | basename }}.yaml"
failed_when: False
tags: always
- name: Include variables from job_vars/{{ zuul_project | basename }}-{{ job_type }}.yaml
include_vars: "job_vars/{{ zuul_project | basename }}-{{ job_type }}.yaml"
when: job_type is defined
failed_when: False
tags: always
- name: Configure compute node trunk
include_tasks: tasks/configure-compute-trunk.yaml
with_items: "{{ groups['all'] }}"
- hosts: win2016-cinder
vars_files:
- zuul-params.yaml
- group_vars/windows
tasks:
- name: Include additional variables based on job_type
include_vars: "group_vars/win2016-cinder-{{ job_type }}"
when: job_type is defined
tags: always
- name: Include additional variables based on job_type and network_type
include_vars: "group_vars/win2016-cinder-{{ job_type }}-{{ network_type }}"
when: network_type is defined
tags: always
- include: tasks/windows/join-ad.yaml
when: join_ad is defined and join_ad
- include: tasks/windows/configure-smbshare.yaml
when: smbshare is defined
- name: Configure services with AD user
set_fact:
service_username: "administrator@{{ ad_domain }}"
when: join_ad is defined and join_ad
- name: Configure services with local user
set_fact:
service_username: "administrator"
when: join_ad is not defined or not join_ad
- name: Start services
win_service:
name: "{{ item.name }}"
display_name: "{{ item.name }}"
description: "{{ item.description }}"
username: "{{ service_username }}"
password: "{{ ansible_ssh_pass }}"
state: restarted
start_mode: auto
path: "{{ win_dir.bin }}\\OpenStackService.exe {{ item.name }} {{ item.binary }} --config-file {{ item.config }}"
with_items: "{{ services }}"
failed_when: False
tags: start-services
- hosts: devstack
vars_files:
- zuul-params.yaml
tasks:
- name: Get Ceph Cinder Keyring file for Ceph WNBD
fetch:
src: "/etc/ceph/ceph.client.cinder.keyring"
dest: "{{ work_dir }}/ceph.keyring"
flat: yes
when: job_type == "ceph" and job_type is defined
- hosts: win2016-compute
vars_files:
- zuul-params.yaml
- group_vars/windows
tasks:
- name: Include additional variables based on project
include_vars: "job_vars/{{ zuul_project | basename }}.yaml"
failed_when: False
tags: always
- name: Include additional variables based on project job_type
include_vars: "job_vars/{{ zuul_project | basename }}-{{ job_type }}.yaml"
when: job_type is defined
failed_when: False
tags: always
- include: tasks/windows/join-ad.yaml
when: join_ad is defined and join_ad
- include: tasks/windows/configure-smbshare.yaml
when: smbshare is defined
- name: Copy Ceph Cinder Keyring file for Ceph WNBD
win_copy:
dest: "C:\\ProgramData\\ceph\\keyring"
src: "{{ work_dir }}/ceph.keyring"
when: job_type == "ceph" and job_type is defined
- name: Check Ceph WNBD connection Cinder Ceph cluster.
win_command: rbd ls --id cinder --pool volumes
register: check_ceph_wnbd
failed_when: "check_ceph_wnbd.rc != 0"
when: job_type == "ceph" and job_type is defined
- include: tasks/windows/enable-live-migration.yaml
when: join_ad is defined and join_ad
- name: Set neutron hyperv agent service
set_fact: services={{ services + neutron_hyperv_agent }}
when: network_type == "hyperv"
- name: Set neutron ovs agent service
set_fact: services={{ services + neutron_ovs_agent }}
when: network_type == "ovs"
- name: Configure services with AD user
set_fact:
service_username: "administrator@{{ ad_domain }}"
service_password: "{{ ansible_ssh_pass }}"
when: join_ad is defined and join_ad
- name: Configure services with local user
set_fact:
service_username: "LocalSystem"
service_password: ""
when: join_ad is not defined or not join_ad
- name: Start services
win_service:
name: "{{ item.name }}"
display_name: "{{ item.name }}"
description: "{{ item.description }}"
username: "{{ service_username }}"
password: "{{ service_password }}"
state: started
start_mode: auto
path: "{{ win_dir.bin }}\\OpenStackService.exe {{ item.name }} {{ item.binary }} --config-file {{ item.config }}"
with_items: "{{ services }}"
failed_when: False
tags: start-services
- hosts: ad
vars_files:
- zuul-params.yaml
- group_vars/windows
tasks:
- name: Include additional variables based on project
include_vars: "job_vars/{{ zuul_project | basename }}.yaml"
failed_when: False
tags: always
- name: Include additional variables based on project job_type
include_vars: "job_vars/{{ zuul_project | basename }}-{{ job_type }}.yaml"
when: job_type is defined
failed_when: False
tags: always
- include: tasks/windows/configure-ad-delegation.yaml
with_items: "{{ win2016_compute_nodes }}"
loop_control:
loop_var: compute_node
when: join_ad is defined and join_ad
- hosts: devstack
vars_files:
- zuul-params.yaml
tasks:
- name: Include variables from job_vars/{{ zuul_project | basename }}.yaml
include_vars: "job_vars/{{ zuul_project | basename }}.yaml"
failed_when: False
tags: always
- name: Include job_type specific variables
include_vars: "job_vars/{{ zuul_project | basename }}-{{ job_type }}.yaml"
when: job_type is defined
failed_when: False
tags: always
- include: tasks/devstack/check-devstack-nova-services.yaml
- include: tasks/devstack/check-devstack-neutron-services.yaml
- include: tasks/devstack/check-devstack-cinder-services.yaml
when: zuul_project == "openstack/cinder" or zuul_project == "openstack/os-brick"
- hosts: win2016-compute
vars_files:
- zuul-params.yaml
- group_vars/windows
tasks:
- name: Include additional variables based on project
include_vars: "job_vars/{{ zuul_project | basename }}.yaml"
failed_when: False
tags: always
- name: Include additional variables based on project job_type
include_vars: "job_vars/{{ zuul_project | basename }}-{{ job_type }}.yaml"
when: job_type is defined
failed_when: False
tags: always
- name: Get neutron_service_check content
set_fact:
neutron_service_check: "{{ groups['devstack'] | map('extract', hostvars, 'neutron_service_check') | list}}"
tags: check-services-tag
- name: Get nova_service_check content
set_fact:
nova_service_check: "{{ groups['devstack'] | map('extract', hostvars, 'nova_service_check') | list}}"
tags: check-services-tag
- name: Get cinder_service_check content
set_fact:
cinder_service_check: "{{ groups['devstack'] | map('extract', hostvars, 'cinder_service_check') | list}}"
when: zuul_project == "openstack/cinder" or zuul_project == "openstack/os-brick"
tags: check-services-tag
- name: Set neutron hyperv agent service
set_fact: services={{ services + neutron_hyperv_agent }}
when: network_type == "hyperv"
tags: check-services-tag
- name: Set neutron ovs agent service
set_fact: services={{ services + neutron_ovs_agent }}
when: network_type == "ovs"
tags: check-services-tag
- include: tasks/windows/collect-service-traceback.yaml
with_items: "{{ services }}"
when: neutron_service_check[0].rc != 0 or nova_service_check[0] !=0 or ((zuul_project == "openstack/cinder" or zuul_project == "openstack/os-brick") and cinder_service_check[0].rc != 0)
- hosts: devstack
vars_files:
- zuul-params.yaml
tasks:
- name: Include variables from job_vars/{{ zuul_project | basename }}.yaml
include_vars: "job_vars/{{ zuul_project | basename }}.yaml"
failed_when: False
tags: always
- name: Include job_type specific variables
include_vars: "job_vars/{{ zuul_project | basename }}-{{ job_type }}.yaml"
when: job_type is defined
failed_when: False
tags: always
- include: tasks/devstack/discover-hosts.yaml
- name: Restart nova api
service:
name: devstack@n-api
state: restarted
become: True
- name: Create folder {{ devstack_dir.home }}/tempest
file:
path: "{{ devstack_dir.home }}/tempest"
state: directory
mode: 0755
tags: run-tests
- name: Write test list files under {{ devstack_dir.home }}
copy:
content: "{{ item.value }}"
dest: "{{ devstack_dir.home }}/{{ item.key }}.txt"
with_dict: "{{ tempest_tests }}"
tags: run-tests
- name: Upload run-tests.sh
copy:
src: files/run-tests.sh
dest: "{{ devstack_dir.home }}/run-tests.sh"
mode: 0755
tags: run-tests
- name: Run post stack bash script
shell: "{{ post_stack_bash }}"
args:
executable: /bin/bash
tags: post-stack-bash
- name: Run tests
shell: |
{{ devstack_dir.home }}/run-tests.sh \
--included-tests {{ devstack_dir.home }}/included-tests.txt \
--excluded-tests {{ devstack_dir.home }}/excluded-tests.txt \
--isolated-tests {{ devstack_dir.home }}/isolated-tests.txt \
> {{ devstack_dir.home }}/tempest/run-tests.sh.log
register: tempest_result
when: run_tests is not defined or run_tests
tags: run-tests