From 05f26031ea8a0e78be4fdea63b5dffe10e4af4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Sat, 7 Oct 2017 00:46:46 +0200 Subject: [PATCH] rolling_update: perform pg check when pgs_num > 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If num_pgs = 0 the check will never return 0. Signed-off-by: Sébastien Han --- infrastructure-playbooks/rolling_update.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index c08dd98c5..6690108db 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -147,7 +147,21 @@ when: - mon_host_count | int == 1 - - name: waiting for the monitor to join the quorum... + - name: get num_pgs - non container + command: ceph --cluster "{{ cluster }}" -s --format json + register: ceph_pgs + delegate_to: "{{ mon_host }}" + when: + - not containerized_deployment + + - name: get num_pgs - container + command: docker exec ceph-mon-{{ hostvars[mon_host]['ansible_hostname'] }} ceph --cluster "{{ cluster }}" -s --format json + register: ceph_pgs + delegate_to: "{{ mon_host }}" + when: + - containerized_deployment + + - name: non container | waiting for the monitor to join the quorum... command: ceph --cluster "{{ cluster }}" -s --format json register: ceph_health_raw until: > @@ -157,8 +171,9 @@ delegate_to: "{{ mon_host }}" when: - not containerized_deployment + - (ceph_pgs.stdout | from_json).pgmap.num_pgs != "0" - - name: waiting for the containerized monitor to join the quorum... + - name: container | waiting for the containerized monitor to join the quorum... command: docker exec ceph-mon-{{ hostvars[mon_host]['ansible_hostname'] }} ceph --cluster "{{ cluster }}" -s --format json register: ceph_health_raw until: > @@ -168,6 +183,7 @@ delegate_to: "{{ mon_host }}" when: - containerized_deployment + - (ceph_pgs.stdout | from_json).pgmap.num_pgs != "0" - name: set osd flags command: ceph osd set {{ item }} --cluster {{ cluster }}