- 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