]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
rolling_update: perform pg check when pgs_num > 0
authorSébastien Han <seb@redhat.com>
Fri, 6 Oct 2017 22:46:46 +0000 (00:46 +0200)
committerSébastien Han <seb@redhat.com>
Sat, 7 Oct 2017 01:39:09 +0000 (03:39 +0200)
If num_pgs = 0 the check will never return 0.

Signed-off-by: Sébastien Han <seb@redhat.com>
infrastructure-playbooks/rolling_update.yml

index c08dd98c5767e4873fcdd331246065383d12c6b5..6690108dbdc643d67b0f07781157a3343e527ba1 100644 (file)
       when:
         - mon_host_count | int == 1
 
-    - name: waiting for the monitor to join the quorum...
+    - name: get num_pgs - non container
+      command: ceph --cluster "{{ cluster }}" -s --format json
+      register: ceph_pgs
+      delegate_to: "{{ mon_host }}"
+      when:
+        - not containerized_deployment
+
+    - name: get num_pgs - container
+      command: docker exec ceph-mon-{{ hostvars[mon_host]['ansible_hostname'] }} ceph --cluster "{{ cluster }}" -s --format json
+      register: ceph_pgs
+      delegate_to: "{{ mon_host }}"
+      when:
+        - containerized_deployment
+
+    - name: non container | waiting for the monitor to join the quorum...
       command: ceph --cluster "{{ cluster }}" -s --format json
       register: ceph_health_raw
       until: >
       delegate_to: "{{ mon_host }}"
       when:
         - not containerized_deployment
+        - (ceph_pgs.stdout | from_json).pgmap.num_pgs != "0"
 
-    - name: waiting for the containerized monitor to join the quorum...
+    - name: container | waiting for the containerized monitor to join the quorum...
       command: docker exec ceph-mon-{{ hostvars[mon_host]['ansible_hostname'] }} ceph --cluster "{{ cluster }}" -s --format json
       register: ceph_health_raw
       until: >
       delegate_to: "{{ mon_host }}"
       when:
         - containerized_deployment
+        - (ceph_pgs.stdout | from_json).pgmap.num_pgs != "0"
 
     - name: set osd flags
       command: ceph osd set {{ item }} --cluster {{ cluster }}