From cf764015ad472853b2284a6593741e2163e99b9a Mon Sep 17 00:00:00 2001 From: Wolfgang Kulhanek Date: Tue, 21 Apr 2026 14:51:38 +0200 Subject: [PATCH 1/2] Update ODF workload for 4.19+ (won't work on 4.18 anymore) --- .../tasks/workload.yml | 44 ++++--------------- .../templates/storagesystem.yaml.j2 | 12 ----- 2 files changed, 9 insertions(+), 47 deletions(-) delete mode 100644 roles/ocp4_workload_openshift_data_foundation/templates/storagesystem.yaml.j2 diff --git a/roles/ocp4_workload_openshift_data_foundation/tasks/workload.yml b/roles/ocp4_workload_openshift_data_foundation/tasks/workload.yml index efea9d5..87e8825 100644 --- a/roles/ocp4_workload_openshift_data_foundation/tasks/workload.yml +++ b/roles/ocp4_workload_openshift_data_foundation/tasks/workload.yml @@ -3,6 +3,15 @@ ansible.builtin.debug: msg: "Setting up OpenShift Data Foundation" +- name: Assert ODF channel is at least stable-4.19 + ansible.builtin.assert: + that: + - ocp4_workload_openshift_data_foundation_channel is match('stable-\d+\.\d+') + - ocp4_workload_openshift_data_foundation_channel | regex_replace('^stable-', '') is version('4.19', '>=') + fail_msg: >- + ODF channel must be at least stable-4.19. + Current channel: {{ ocp4_workload_openshift_data_foundation_channel }} + - name: Define label_selector list ansible.builtin.set_fact: label_selector_list: @@ -74,18 +83,6 @@ state: present template: subscription.yaml.j2 -- name: Wait for the CRD storagesystems to become available - kubernetes.core.k8s_info: - api_version: apiextensions.k8s.io/v1 - kind: CustomResourceDefinition - name: storagesystems.odf.openshift.io - register: r_crd_storagesystems - retries: 200 - delay: 10 - until: - - r_crd_storagesystems.resources is defined - - r_crd_storagesystems.resources | list | length == 1 - - name: Wait for the CRD storagecluster to become available kubernetes.core.k8s_info: api_version: apiextensions.k8s.io/v1 @@ -124,29 +121,6 @@ state: present template: storagecluster.yaml.j2 -- name: Create the ODF StorageSystem - kubernetes.core.k8s: - state: present - template: storagesystem.yaml.j2 - register: r_k8s_run - until: r_k8s_run is not failed - delay: 10 - retries: 3 - -- name: Wait for ODF Storage System to finish deploying - kubernetes.core.k8s_info: - api_version: odf.openshift.io/v1alpha1 - kind: StorageSystem - name: ocs-storagecluster-storagesystem - namespace: openshift-storage - wait: true - wait_condition: - reason: ReconcileCompleted - status: 'True' - type: Available - wait_sleep: 10 - wait_timeout: "{{ ocp4_workload_openshift_data_foundation_ceph_storage_system_deploy_timeout }}" - - name: Wait for ODF Storage Cluster to finish deploying kubernetes.core.k8s_info: api_version: ocs.openshift.io/v1 diff --git a/roles/ocp4_workload_openshift_data_foundation/templates/storagesystem.yaml.j2 b/roles/ocp4_workload_openshift_data_foundation/templates/storagesystem.yaml.j2 deleted file mode 100644 index 03400b1..0000000 --- a/roles/ocp4_workload_openshift_data_foundation/templates/storagesystem.yaml.j2 +++ /dev/null @@ -1,12 +0,0 @@ ---- -apiVersion: odf.openshift.io/v1alpha1 -kind: StorageSystem -metadata: - name: ocs-storagecluster-storagesystem - namespace: openshift-storage - finalizers: - - storagesystem.odf.openshift.io -spec: - kind: storagecluster.ocs.openshift.io/v1 - name: ocs-storagecluster - namespace: openshift-storage From f918d1dd2c9d9aaeec420b13922b8da244e44e57 Mon Sep 17 00:00:00 2001 From: Wolfgang Kulhanek Date: Tue, 21 Apr 2026 17:03:56 +0200 Subject: [PATCH 2/2] Fix API Version for ConsolePlugin --- .../tasks/workload.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/roles/ocp4_workload_openshift_data_foundation/tasks/workload.yml b/roles/ocp4_workload_openshift_data_foundation/tasks/workload.yml index 87e8825..2704643 100644 --- a/roles/ocp4_workload_openshift_data_foundation/tasks/workload.yml +++ b/roles/ocp4_workload_openshift_data_foundation/tasks/workload.yml @@ -67,6 +67,17 @@ kind: Namespace name: openshift-storage +- name: Label openshift-storage namespace for cluster monitoring + kubernetes.core.k8s: + api_version: v1 + kind: Namespace + name: openshift-storage + state: patched + definition: + metadata: + labels: + openshift.io/cluster-monitoring: "true" + - name: Create CatalogSource when: ocp4_workload_openshift_data_foundation_catalogsource_setup | bool kubernetes.core.k8s: @@ -97,11 +108,11 @@ - name: Wait for the console plugin to become available kubernetes.core.k8s_info: - api_version: console.openshift.io/v1alpha1 + api_version: console.openshift.io/v1 kind: ConsolePlugin name: odf-console register: r_console_plugin - retries: 200 + retries: 100 delay: 10 until: r_console_plugin.resources | list | length == 1 @@ -120,6 +131,10 @@ kubernetes.core.k8s: state: present template: storagecluster.yaml.j2 + register: r_storagecluster + retries: 100 + delay: 5 + until: r_storagecluster is success - name: Wait for ODF Storage Cluster to finish deploying kubernetes.core.k8s_info: