]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
shrink-mgr: modify existing mgr check
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 28 Jun 2021 18:16:03 +0000 (20:16 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 29 Jun 2021 15:52:22 +0000 (17:52 +0200)
Do not rely on the inventory aliases in order to check if the selected
manager to be removed is present.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1967897
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 26a7256c4cec17fc9bc20a239c112cbf8584be09)

infrastructure-playbooks/shrink-mgr.yml

index f99726890ee40829ca778c90c306923bf3a83282..66745f7c607a461395a08de1a7b09471f81e8086 100644 (file)
               manager each time the playbook runs."
       when: mgr_to_kill is not defined
 
-    - name: exit playbook, if the manager is not part of the inventory
-      fail:
-        msg: "It seems that the host given is not part of your inventory,
-              please make sure it is."
-      when:
-        - mgr_to_kill not in active_mgr
-        - mgr_to_kill not in standbys_mgr
-
     - name: exit playbook, if user did not mean to shrink cluster
       fail:
         msg: "Exiting shrink-mgr playbook, no manager was removed.
       set_fact:
         mgr_to_kill_hostname: "{{ hostvars[mgr_to_kill]['ansible_facts']['hostname'] }}"
 
+    - name: exit playbook, if the selected manager is not present in the cluster
+      fail:
+        msg: "It seems that the host given is not present in the cluster."
+      when:
+        - mgr_to_kill_hostname not in active_mgr
+        - mgr_to_kill_hostname not in standbys_mgr
+
   tasks:
     - name: stop manager services and verify it
       block: