From 2ac379a38e87539e4f498239882240170ab699c0 Mon Sep 17 00:00:00 2001 From: jarpat Date: Thu, 27 Jun 2024 11:43:02 -0400 Subject: [PATCH] initial changes --- roles/monitoring/tasks/main.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/roles/monitoring/tasks/main.yaml b/roles/monitoring/tasks/main.yaml index eb6ee5dd..8db1ad52 100644 --- a/roles/monitoring/tasks/main.yaml +++ b/roles/monitoring/tasks/main.yaml @@ -50,6 +50,30 @@ tags: - cluster-logging +- name: V4M - check if storage class is being used + ansible.builtin.shell: | + kubectl --kubeconfig {{ KUBECONFIG }} get pv --output=custom-columns='PORT:.spec.storageClassName' | grep -o v4m | wc -l + register: sc_users + when: + - PROVIDER is not none + - PROVIDER in ["azure","aws","gcp"] + - V4_CFG_MANAGE_STORAGE is not none + - V4_CFG_MANAGE_STORAGE|bool + tags: + - uninstall + +- name: V4M - storageclass uninstall status + debug: + msg: "{{ sc_users.stdout }} Persistent Volumes still referring to the v4m Storage Class, skipping deletion" + when: + - PROVIDER is not none + - PROVIDER in ["azure","aws","gcp"] + - V4_CFG_MANAGE_STORAGE is not none + - V4_CFG_MANAGE_STORAGE|bool + - sc_users.stdout | int > 0 + tags: + - uninstall + - name: V4M - remove storageclass kubernetes.core.k8s: kubeconfig: "{{ KUBECONFIG }}" @@ -60,5 +84,6 @@ - PROVIDER == "azure" - V4_CFG_MANAGE_STORAGE is not none - V4_CFG_MANAGE_STORAGE|bool + - sc_users.stdout | int == 0 tags: - uninstall