]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Check ceph_health_raw.stdout value as string during mon bootstrap
authorfpantano <fpantano@redhat.com>
Wed, 3 Apr 2019 16:35:10 +0000 (18:35 +0200)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Wed, 3 Apr 2019 20:55:05 +0000 (20:55 +0000)
According to rdo testing https://review.rdoproject.org/r/#/c/18721
a check on the output of the ceph_health value is added to
allow the playbook to make several attempts (according to the
retry/delay variables) when waiting the cluster quorum or
when the container bootstrap is not ended.
It avoids the failure of the command execution when it doesn't
receive a valid json object to decode (because cluster is too
slow to boostrap compared to ceph-ansible task execution).

Signed-off-by: fpantano <fpantano@redhat.com>
roles/ceph-mon/tasks/ceph_keys.yml

index 13006d14052f73cf2893f3607cedabbb52e7c83f..4be3721c8bd000b384c4b8f95b51d66db7600818 100644 (file)
@@ -11,7 +11,7 @@
   register: ceph_health_raw
   run_once: true
   until: >
-    (ceph_health_raw.stdout | default('{}') | from_json)['state'] in ['leader', 'peon']
+    (ceph_health_raw.stdout != "") and (ceph_health_raw.stdout | default('{}') | from_json)['state'] in ['leader', 'peon']
   retries: "{{ handler_health_mon_check_retries }}"
   delay: "{{ handler_health_mon_check_delay }}"
   changed_when: false