From 39bf102b64448fc3a2e9654ebb9ea992be33ea34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Mon, 16 Oct 2017 14:27:57 +0200 Subject: [PATCH] switch: nicer way to check mon quorum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit re-use the same syntax as rolling_udate.yml Signed-off-by: Sébastien Han --- ...on-containerized-to-containerized-ceph-daemons.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index a11034e46..661fbbe95 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -126,16 +126,15 @@ post_tasks: # We don't do a container test by running 'docker exec ...' since not all the monitors have switched to containers yet. # Thus, we continue to use the 'ceph' binary from the host, there is no issue with that. - - name: waiting for the containerized monitor to join the quorum... - shell: | - ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print(json.load(sys.stdin)["quorum_names"])' - register: result - until: "{{ ansible_hostname in result.stdout }}" + - name: non container | waiting for the monitor to join the quorum... + command: ceph --cluster "{{ cluster }}" -s --format json + register: ceph_health_raw + until: > + hostvars[mon_host]['ansible_hostname'] in (ceph_health_raw.stdout | from_json)["quorum_names"] retries: "{{ health_mon_check_retries }}" delay: "{{ health_mon_check_delay }}" delegate_to: "{{ mon_host }}" - - name: switching from non-containerized to containerized ceph mgr hosts: