mirror of https://github.com/ceph/ceph-ansible.git
mon: default ceph_health_raw to json
During the first iteration, the command won't return anything, or can simply fail and might not return a valid json structure. Ansible will fail parsing it in the filter `from_json` so let's default that variable to empty dictionary. Signed-off-by: Sébastien Han <seb@redhat.com>pull/3375/head
parent
cfac79bec4
commit
8d4de44f5d
|
@ -3,7 +3,7 @@
|
|||
command: "ceph --cluster {{ cluster }} -n mon. -k /var/lib/ceph/mon/{{ cluster }}-{{ ansible_hostname }}/keyring mon_status --format json"
|
||||
register: ceph_health_raw
|
||||
until: >
|
||||
(ceph_health_raw.stdout | from_json)['state'] in ['leader', 'peon']
|
||||
(ceph_health_raw.stdout | default({}) | from_json)['state'] in ['leader', 'peon']
|
||||
retries: "{{ handler_health_mon_check_retries }}"
|
||||
delay: "{{ handler_health_mon_check_delay }}"
|
||||
when:
|
||||
|
|
Loading…
Reference in New Issue