From 33a3aa0ddace8daa37e2d0df2df49f94dc5038b2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Sat, 7 Oct 2017 03:42:09 +0200 Subject: [PATCH] switch: check pgs only when num_pgs > 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Han --- ...rom-non-containerized-to-containerized-ceph-daemons.yml | 7 +++++++ 1 file changed, 7 insertions(+) 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 e0e7b2ac8..54a81e1ed 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,6 +280,11 @@ - ceph-osd post_tasks: + - name: get num_pgs + command: docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster "{{ cluster }}" -s --format json + register: ceph_pgs + delegate_to: "{{ groups[mon_group_name][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 @@ -290,6 +295,8 @@ delegate_to: "{{ groups[mon_group_name][0] }}" retries: "{{ health_osd_check_retries }}" delay: "{{ health_osd_check_delay }}" + when: + - (ceph_pgs.stdout | from_json).pgmap.num_pgs != "0" - name: switching from non-containerized to containerized ceph mds -- 2.47.3