mirror of https://github.com/ceph/ceph-ansible.git
update: add default values when setting fact
This commit adds a default value in the `with_dict` because when using
python 2.7, if a task using a `with_dict` has a condition, it is
evaluated anyway whereas in python 3 it isn't.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1766499
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit e9823f319b
)
pull/4695/head
parent
56f0cf79d9
commit
e4c657d711
|
@ -572,7 +572,7 @@
|
|||
- name: set_fact mds_active_name
|
||||
set_fact:
|
||||
mds_active_name: "{{ (_mds_active_name.stdout | from_json)['filesystems'][0]['mdsmap']['info'][item.key]['name'] }}"
|
||||
with_dict: "{{ (_mds_active_name.stdout | from_json).filesystems[0]['mdsmap']['info'] }}"
|
||||
with_dict: "{{ (_mds_active_name.stdout | default('{}') | from_json).filesystems[0]['mdsmap']['info'] | default({}) }}"
|
||||
|
||||
- name: set_fact mds_active_host
|
||||
set_fact:
|
||||
|
|
Loading…
Reference in New Issue