]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
switch: check pgs only when num_pgs > 0 2011/head
authorSébastien Han <seb@redhat.com>
Sat, 7 Oct 2017 01:42:09 +0000 (03:42 +0200)
committerSébastien Han <seb@redhat.com>
Sat, 7 Oct 2017 01:42:09 +0000 (03:42 +0200)
Signed-off-by: Sébastien Han <seb@redhat.com>
infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml

index e0e7b2ac84dde5304df0f5415a8c462c623698d2..54a81e1ed3db0ab28fda71d52c81fd9767c90371 100644 (file)
     - 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
       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