]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
rolling_update: ensure pgs_by_state has at least 1 entry
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 25 Sep 2018 12:21:44 +0000 (14:21 +0200)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Tue, 25 Sep 2018 14:58:54 +0000 (14:58 +0000)
Previous commit c13a3c3 has removed a condition.

This commit brings back this condition which is essential to ensure we
won't hit a false positive result in the `when` condition for the check
PGs task.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
infrastructure-playbooks/rolling_update.yml

index 5bb1b4983f8a02cd01eda02bce2536c98abfc347..3013fffa3cd8e9c3664ffad08b881e04a3c26e2f 100644 (file)
       command: "{{ docker_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} -s --format json"
       register: ceph_health_post
       until: >
-        ((ceph_health_post.stdout | from_json).pgmap.pgs_by_state | selectattr('state_name', 'search', '^active\\+clean') | map(attribute='count') | list | sum) == (ceph_pgs.stdout | from_json).pgmap.num_pgs
+        (((ceph_health_post.stdout | from_json).pgmap.pgs_by_state | length) > 0)
+        and
+        (((ceph_health_post.stdout | from_json).pgmap.pgs_by_state | selectattr('state_name', 'search', '^active\\+clean') | map(attribute='count') | list | sum) == (ceph_pgs.stdout | from_json).pgmap.num_pgs)
       delegate_to: "{{ groups[mon_group_name][0] }}"
       retries: "{{ health_osd_check_retries }}"
       delay: "{{ health_osd_check_delay }}"