]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
shrink-mon: search mon in the quorum_names list
authorDimitri Savineau <dsavinea@redhat.com>
Thu, 12 Sep 2019 15:51:37 +0000 (11:51 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 18 Sep 2019 12:35:02 +0000 (14:35 +0200)
If we're looking at the mon hostname in the ceph status output then
there's some scenarios where this could be true.
If we collocate some services (mons, mgrs, etc..) then the hostname of
the monitor to shrink will still be present in the ceph status (like
in mgrs or other).
Instead we should check the hostame only in the mon part of the output.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
infrastructure-playbooks/shrink-mon.yml

index 1acc5a91825cd9d23e78435b3e7d004f47037549..5f012d510c20b8c632e6eed5da8f6e085f858160 100644 (file)
           msg: "The monitor has been successfully removed from the cluster.
           Please remove the monitor entry from the rest of your ceph configuration files, cluster wide."
       run_once: true
-      when: mon_to_kill_hostname not in result.stdout
+      when: mon_to_kill_hostname not in (result.stdout | from_json)['quorum_names']
 
     - name: fail if monitor is still part of the cluster
       fail:
           msg: "Monitor appears to still be part of the cluster, please check what happened."
       run_once: true
-      when: mon_to_kill_hostname in result.stdout
+      when: mon_to_kill_hostname in (result.stdout | from_json)['quorum_names']
 
     - name: show ceph health
       command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} -s"