-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlegacy_ocp_testing.yaml
197 lines (173 loc) · 5.66 KB
/
legacy_ocp_testing.yaml
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
---
- name: Cleanup the OCP setup and prepare the environment for testing OCP on legacy OSP (17.1 or 16.2)
hosts: localhost
gather_facts: no
vars_files:
- "../configs/global.yml"
pre_tasks:
- name: Gather host environment variables
ansible.builtin.setup:
gather_subset:
- env
- name: Cleanup workspace flags - Remove the stage_unstable_flag if it exists
ansible.builtin.file:
path: "{{ stage_unstable_flag }}"
state: absent
tasks:
- name: Discover the OSP version
ansible.builtin.include_role:
name: shiftstack.tools.tools_get_deploy_info
tasks_from: discover_osp_version.yml
- name: Cleanup the setup
ansible.builtin.include_role:
name: shiftstack.stages.cleanup
when: "'cleanup' in stages"
- name: Restore the OpenStack original config directory (includes the clouds.yaml and secure.yaml)
ansible.builtin.copy:
src: "{{ home_dir }}/.original-config/openstack/"
dest: "{{ home_dir }}/.config/openstack/"
remote_src: yes
mode: u=rwx,g=rwx,o=rwx
when: "'cleanup' in stages or 'prepare' in stages"
- name: Prepare the OpenShift environment for installation and testing new candidate
hosts: localhost
gather_facts: no
vars_files:
- "../configs/global.yml"
- "../configs/secret.yaml"
- "../configs/legacy_ocp_testing.yaml"
tasks:
- name: Prepare setup for OCP installation
ansible.builtin.include_role:
name: shiftstack.stages.prepare
when: "'prepare' in stages"
post_tasks:
- name: Update the Ansible inventory in case not deploying an installer host
ansible.builtin.include_role:
name: shiftstack.tools.tools_ansible_inventory
tasks_from: create_installer_group.yml
when: "not deploy_installer_host"
- name: Prepare the OpenShift installer and client in the installer host
hosts: installer
gather_facts: no
vars_files:
- "../configs/global.yml"
- "../configs/legacy_ocp_testing.yaml"
pre_tasks:
- name: Gather host environment variables
ansible.builtin.setup:
gather_subset:
- env
- name: Set the openstack_version based on the previous discovery
ansible.builtin.set_fact:
openstack_version: "{{ hostvars['localhost']['openstack_version'] }}"
tasks:
- name: Get OCP installer and client in the installer host
ansible.builtin.include_role:
name: shiftstack.stages.prepare
tasks_from: get_installer.yml
when: "'prepare' in stages"
- name: Install OpenShift new candidate on OSP
hosts: installer
gather_facts: no
vars_files:
- "../configs/global.yml"
- "../configs/secret.yaml"
- "../configs/legacy_ocp_testing.yaml"
tasks:
- name: Install OCP on setup
ansible.builtin.include_role:
name: shiftstack.stages.install
when: "'install' in stages"
- name: Post OpenShift installation stage
hosts: installer
gather_facts: no
vars_files:
- "../configs/global.yml"
tasks:
- name: Discover OCP version and networkType
ansible.builtin.include_role:
name: shiftstack.tools.tools_get_deploy_info
tasks_from: discover_ocp_version.yml
- name: Run post operations and OCP verification checks on setup
ansible.builtin.include_role:
name: shiftstack.stages.post
when: "'post' in stages"
- name: Verify the OpenShift cluster
hosts: installer
gather_facts: no
vars_files:
- "../configs/global.yml"
tasks:
- name: Run OCP verification checks
ansible.builtin.include_role:
name: shiftstack.stages.verification
vars:
post_installatin: true
when: "'verification' in stages"
- name: Run Openstack-Test on OpenShift
hosts: installer
gather_facts: no
vars_files:
- "../configs/global.yml"
tasks:
- name: Run Openstack-Test on OCP
ansible.builtin.include_role:
name: shiftstack.stages.openstack_test
when: "'openstack_test' in stages"
- name: Run Openshift Conformance Test on OpenShift
hosts: installer
gather_facts: no
vars_files:
- "../configs/global.yml"
tasks:
- name: Run Openshift Conformance Test on OCP
ansible.builtin.include_role:
name: shiftstack.stages.conformance_test
when: "'conformance_test' in stages"
- name: Run Openshift Cinder CSI Tests on OpenShift
hosts: installer
gather_facts: no
vars_files:
- "../configs/global.yml"
tasks:
- name: Run Openshift Cinder CSI Tests on OCP
ansible.builtin.include_role:
name: shiftstack.stages.csi_tests
tasks_from: openshift_cinder_csi.yml
when: "'cinder_csi_tests' in stages"
- name: Run Openshift Manila CSI Tests on OpenShift
hosts: installer
gather_facts: no
vars_files:
- "../configs/global.yml"
tasks:
- name: Run Openshift Manila CSI Tests on OCP
ansible.builtin.include_role:
name: shiftstack.stages.csi_tests
tasks_from: openshift_manila_csi.yml
when: "'manila_csi_tests' in stages"
- name: Post steps
hosts: installer
gather_facts: no
vars_files:
- "../configs/global.yml"
pre_tasks:
- name: Gather host environment variables
ansible.builtin.setup:
gather_subset:
- env
tasks:
- name: Check if source directory exists
ansible.builtin.stat:
path: "{{ artifacts_dir }}"
register: source_dir_stat
- name: Synchronize artifacts from the Ansible Managed Node to Ansible Controller
ansible.posix.synchronize:
src: "{{ artifacts_dir }}"
dest: "{{ controller_home_dir }}"
mode: pull
recursive: yes
times: false
perms: false
when: source_dir_stat.stat.exists