]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
purge-iscsi-gateways: remove node from dashboard
authorDimitri Savineau <dsavinea@redhat.com>
Mon, 6 Jan 2020 20:22:51 +0000 (15:22 -0500)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 8 Jan 2020 18:29:59 +0000 (19:29 +0100)
When using the ceph dashboard with iscsi gateways nodes we also need to
remove the nodes from the ceph dashboard list.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1786686
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 931a842f21e5eb847ad371640307b7c0fef198bd)

infrastructure-playbooks/purge-iscsi-gateways.yml

index 4f4ce04cdace21a446b217285d9be09dd8a515ad..c0f752e2fb94c5b9813befc14b10c395be47b30f 100644 (file)
         - tcmu-runner
         - rbd-target-api
         - rbd-target-gw
+
+- name: remove the gateways from the ceph dashboard
+  hosts: mons
+  become: true
+  tasks:
+    - import_role:
+        name: ceph-defaults
+
+    - name: iscsi gateways with ceph dashboard
+      when: dashboard_enabled | bool
+      run_once: true
+      block:
+        - import_role:
+            name: ceph-facts
+
+        - name: get iscsi gateway list
+          command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} dashboard iscsi-gateway-list -f json"
+          changed_when: false
+          register: gateways
+
+        - name: remove iscsi gateways
+          command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} dashboard iscsi-gateway-rm {{ item }}"
+          with_items: '{{ (gateways.stdout | from_json)["gateways"] }}'