|
34 | 34 | kind: Namespace |
35 | 35 | metadata: |
36 | 36 | name: "{{ lso_namespace }}" |
37 | | - when: lso_namespace is defined |
38 | | - |
39 | | -# Disable all default operator sources |
40 | | -- name: Disable all default operator sources |
41 | | - command: oc patch operatorhub.config.openshift.io/cluster -p='{"spec":{"disableAllDefaultSources":true}}' --type=merge |
42 | | - register: patch_operatorhub |
43 | | - failed_when: patch_operatorhub.rc != 0 |
| 37 | + when: lso_namespace is defined |
44 | 38 |
|
45 | 39 | # Create ICSP & catalogsource for installing local storage operator |
46 | 40 | - name: Local Storage Operator deployment |
|
91 | 85 | source: "{{ lso_catalogsource_name }}" |
92 | 86 | sourceNamespace: openshift-marketplace |
93 | 87 |
|
94 | | -- name: Wait for CSV to be created |
95 | | - pause: |
96 | | - seconds: 30 |
97 | | - |
98 | 88 | # Check LocalStorage Operator progress |
99 | 89 | - name: Check LocalStorage Operator progress |
100 | 90 | command: oc get ip -n "{{ lso_namespace }}" |
101 | 91 | register: ip_status |
| 92 | + until: ip_status.stdout|int == 0 and ip_status.stderr == "" |
| 93 | + retries: 10 |
| 94 | + delay: 30 |
102 | 95 | failed_when: |
103 | 96 | - ip_status.rc != 0 |
104 | 97 | - ip_status.stdout == "" |
|
107 | 100 | - name: Check LocalStorage Operator CSV |
108 | 101 | shell: "oc get csv -A | grep local-storage-operator | grep Succeeded" |
109 | 102 | register: csv_status |
| 103 | + until: csv_status.stdout != "" and csv_status.stderr == "" |
| 104 | + retries: 10 |
| 105 | + delay: 30 |
110 | 106 | failed_when: csv_status.rc != 0 |
111 | 107 | when: |
112 | 108 | - lso_namespace is defined |
|
161 | 157 | - name: Verify creation of diskmanager pods |
162 | 158 | shell: "oc get pods -n openshift-local-storage --selector=app=diskmaker-manager | grep Running" |
163 | 159 | register: check_pods |
| 160 | + until: check_pods.stdout|int == 0 and check_pods.stderr == "" |
| 161 | + retries: 10 |
| 162 | + delay: 30 |
164 | 163 | failed_when: check_pods.rc != 0 |
165 | 164 |
|
166 | 165 | - name: Verify the creation of StorageClass |
167 | 166 | command: oc get sc localblock |
168 | 167 | register: check_sc |
| 168 | + until: check_sc.stdout|int == 0 and check_sc.stderr == "" |
| 169 | + retries: 10 |
| 170 | + delay: 30 |
169 | 171 | failed_when: check_sc.rc != 0 |
170 | 172 |
|
171 | | -- name: Wait for persistent volumes to be created |
172 | | - pause: |
173 | | - minutes: 1 |
174 | | - |
175 | 173 | - name: Delete existing PersistentVolumeClaim and Pod (if they exist) |
176 | 174 | kubernetes.core.k8s: |
177 | 175 | state: absent |
|
229 | 227 | - devicePath: "{{ device_path }}" |
230 | 228 | name: local-data |
231 | 229 |
|
232 | | -- name: Wait for pods to be created |
233 | | - pause: |
234 | | - seconds: 30 |
235 | | - |
236 | 230 | - name: Verify the status of Persistent Volumes |
237 | 231 | shell: "oc get pv --selector storage.openshift.com/owner-kind=LocalVolumeSet | grep Bound" |
238 | 232 | register: check_pv |
| 233 | + until: check_pv.stdout|int == 0 and check_pv.stderr == "" |
| 234 | + retries: 10 |
| 235 | + delay: 30 |
239 | 236 | failed_when: check_pv.rc != 0 |
240 | 237 |
|
241 | 238 | - name: Verify PVC status |
242 | 239 | shell: "oc get pvc test-local-claim -n default | grep Bound" |
243 | 240 | register: pvc_status |
| 241 | + until: pvc_status.stdout|int == 0 and pvc_status.stderr == "" |
| 242 | + retries: 10 |
| 243 | + delay: 30 |
244 | 244 | failed_when: pvc_status.rc != 0 |
245 | 245 |
|
246 | 246 | - name: Verify Pod status |
247 | 247 | shell: "oc get pods busybox-lso -n default -o jsonpath='{.status.phase}'" |
248 | 248 | register: pod_status |
| 249 | + until: pod_status.stdout|int == 0 and pod_status.stderr == "" |
249 | 250 | retries: 5 |
250 | 251 | delay: 10 |
251 | | - failed_when: pod_status.stdout != "Running" |
| 252 | + failed_when: pod_status.stdout != "Pending" |
0 commit comments