Skip to content

Commit bd85cfb

Browse files
committed
Making powervc-certificate optional
1 parent f78251e commit bd85cfb

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

playbooks/roles/ocp-csi-driver/README.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,25 @@ Requirements
1515

1616
- Running OCP 4.x cluster is needed.
1717
- Cluster must not contain default StorageClass.
18-
- A secret with PowerVC certificate in the `default` namespace.
19-
Secret name must be `powervc-certificate` and must contains `certificate` field.
20-
eg.
21-
22-
```
23-
apiVersion: v1
24-
kind: Secret
25-
metadata:
26-
name: powervc-certificate
27-
namespace: default
28-
type: Opaque
29-
stringData:
30-
certificate: |
31-
-----BEGIN CERTIFICATE-----
32-
IBAgwIBUCCAwIBAgIUn2gAbw0LWHtozBNiLdUtELvr1pyPAzcNAQYjAwDQYJKoZIhv
33-
...
34-
Un2gAIBAb -----END CERTIFICATE-----
35-
```
18+
- Optional :
19+
- A secret with PowerVC certificate in the `default` namespace
20+
Secret name should be `powervc-certificate` and must contains `certificate` field.
21+
eg.
22+
23+
```
24+
apiVersion: v1
25+
kind: Secret
26+
metadata:
27+
name: powervc-certificate
28+
namespace: default
29+
type: Opaque
30+
stringData:
31+
certificate: |
32+
-----BEGIN CERTIFICATE-----
33+
IBAgwIBUCCAwIBAgIUn2gAbw0LWHtozBNiLdUtELvr1pyPAzcNAQYjAwDQYJKoZIhv
34+
...
35+
Un2gAIBAb -----END CERTIFICATE-----
36+
```
3637
3738
Role Variables
3839
--------------

playbooks/roles/ocp-csi-driver/tasks/main.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,15 @@
117117
name: powervc-certificate
118118
namespace: default
119119
register: powervc_certificate
120+
ignore_errors: yes
120121

121-
- name: Fail if the powervc-certificate does not exists in default namespace
122-
fail:
122+
- name: If the powervc-certificate does not exists in default namespace
123+
debug:
123124
msg: "PowerVC certificate secret is not present!"
124125
when: powervc_certificate.resources | length == 0
125126

126-
- fail:
127+
- name: If powervc-certificate is empty
128+
debug:
127129
msg: "PowerVC certificate is empty! Please check the certificate's secret."
128130
when: >
129131
(powervc_certificate.resources[0].data.certificate is not defined) or

0 commit comments

Comments
 (0)