Skip to content

Commit 9ab1181

Browse files
committed
Pushing changes to ensure that NFS imgreg is disabled if OCS is configured
1 parent ccf325d commit 9ab1181

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tasks/main.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@
7171
delay: 30
7272
until: storage_cluster_success is not failed
7373

74+
- name: Unset default storage class for nfs
75+
ansible.builtin.command: >
76+
oc patch storageclass nfs
77+
-p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
78+
register: default_nfsclass_success
79+
retries: 1
80+
delay: 30
81+
until: default_nfsclass_success is not failed
82+
when: ocp4_aio_deploy_nfs
83+
7484
- name: Set default storage class to be ocs-storagecluster-ceph-rbd
7585
ansible.builtin.command: >
7686
oc patch storageclass ocs-storagecluster-ceph-rbd
@@ -80,6 +90,30 @@
8090
delay: 30
8191
until: default_class_success is not failed
8292

93+
- name: Create PVC for the Image Registry on OCS
94+
k8s:
95+
state: present
96+
definition: "{{ lookup('file', 'ceph-imgreg-pvc.yaml') }}"
97+
register: imgreg_volume_success
98+
retries: 5
99+
delay: 30
100+
until: imgreg_volume_success is not failed
101+
102+
- name: Enable OCS based PVC based storage for Image Registry
103+
ansible.builtin.shell: >
104+
oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"storage":{"pvc": {"claim": "ocs-imgreg"}}}}'
105+
106+
- name: Delete the old PVC that may have been created for NFS
107+
k8s:
108+
kind: pvc
109+
namespace: openshift-image-registry
110+
name: image-registry-storage
111+
state: absent
112+
113+
- name: Wait for image registry to stabilise on OCS
114+
pause:
115+
minutes: 2
116+
83117
- name: Enable Ceph Tools pod for troubleshooting
84118
ansible.builtin.command: >
85119
oc patch OCSInitialization ocsinit -n openshift-storage

0 commit comments

Comments
 (0)