From c3c63ae53928a276e1ae8498476bd472ae4ddcac Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Fri, 6 Oct 2017 19:52:05 +0200 Subject: [PATCH] switch: rework and fix clean pg wait MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Han --- ...containerized-to-containerized-ceph-daemons.yml | 14 ++++++++------ 1 file changed, 8 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 a924d5eed..e0e7b2ac8 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 @@ -280,14 +280,16 @@ - ceph-osd post_tasks: - - name: waiting for clean pgs... - shell: | - test "[""$(docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print(json.load(sys.stdin)["pgmap"]["num_pgs"])')""]" = "$(docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print [ i["count"] for i in json.load(sys.stdin)["pgmap"]["pgs_by_state"] if i["state_name"] == "active+clean"]')" - register: result - until: result.rc == 0 + - name: container - waiting for clean pgs... + command: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s --format json" + register: ceph_health_post + until: > + ((ceph_health_post.stdout | from_json).pgmap.pgs_by_state | length) == 1 + and + (ceph_health_post.stdout | from_json).pgmap.pgs_by_state.0.state_name == "active+clean" + delegate_to: "{{ groups[mon_group_name][0] }}" retries: "{{ health_osd_check_retries }}" delay: "{{ health_osd_check_delay }}" - delegate_to: "{{ groups[mon_group_name][0] }}" - name: switching from non-containerized to containerized ceph mds -- 2.39.5