From: pinotelio Date: Mon, 4 Apr 2022 09:48:14 +0000 (+0430) Subject: ceph-facts: fix ansible templating error for auto osd discovery X-Git-Tag: v6.0.26~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bc84a1cc319d2f7528979cab5c0a258dcc72ec5a;p=ceph-ansible.git ceph-facts: fix ansible templating error for auto osd discovery This commit fixes templating error that occurs when using auto osd discovery. Getting the len before converting the result to a list causes "object of type generator has no len()" error. Signed-off-by: pinotelio (cherry picked from commit f288364c5c268e61d49165704900e8e01ca643c8) --- diff --git a/roles/ceph-facts/tasks/devices.yml b/roles/ceph-facts/tasks/devices.yml index 6c4af65ec..4393f7cf3 100644 --- a/roles/ceph-facts/tasks/devices.yml +++ b/roles/ceph-facts/tasks/devices.yml @@ -87,5 +87,5 @@ - item.value.sectors != "0" - item.value.partitions|count == 0 - item.value.holders|count == 0 - - ansible_facts['mounts'] | selectattr('device', 'equalto', device) | length == 0 + - ansible_facts['mounts'] | selectattr('device', 'equalto', device) | list | length == 0 - item.key is not match osd_auto_discovery_exclude