From ed2c1a2bfecc5b2dbec468278c3d9509b4a8e760 Mon Sep 17 00:00:00 2001 From: Elvir Kuric Date: Thu, 30 Mar 2023 11:04:21 +0200 Subject: [PATCH] - switch to default namespace before deletion of grafana namespace --- README.md | 2 -- purge-grafana.yml | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bdd18ec..7640635 100644 --- a/README.md +++ b/README.md @@ -94,8 +94,6 @@ OR # ansible-playbook purge-local.yml ``` -NB. When you're removing you OpenShift based deployment, remember to use `oc project default` to ensure you're not in the odf-grafana namesspace. - ### Adding a dashboard If you need to add dashboards to your instance after a deployment, you can use the `add-dashboard.yml` playbook and specify the path to the dashboard file either from the all.yml file or as an extra-vars on the playbook command line. diff --git a/purge-grafana.yml b/purge-grafana.yml index 91fc5ec..f32198a 100644 --- a/purge-grafana.yml +++ b/purge-grafana.yml @@ -30,6 +30,11 @@ msg: Aborted the namespace delete when: confirm.user_input.upper() != 'YES' + - name: Switch to default namespace before deleting '{{ grafana_namespace }}' + command: + cmd: oc project default + when: confirm.user_input.upper() == 'YES' + - name: Deleting the namespace command: cmd: oc delete ns {{ grafana_namespace }}