From: Sébastien Han Date: Sat, 7 Oct 2017 01:42:09 +0000 (+0200) Subject: switch: check pgs only when num_pgs > 0 X-Git-Tag: v3.0.0rc18^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=33a3aa0ddace8daa37e2d0df2df49f94dc5038b2;p=ceph-ansible.git switch: check pgs only when num_pgs > 0 Signed-off-by: Sébastien Han --- 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