]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
defaults/facts: Use list instead of keys
authorBoris Ranto <branto@redhat.com>
Tue, 20 Nov 2018 10:46:08 +0000 (11:46 +0100)
committerSébastien Han <seb@redhat.com>
Tue, 20 Nov 2018 17:48:22 +0000 (18:48 +0100)
It is safer to use the list filter than the keys() method since the keys
method does have some interoperability issues between python2 and
python3 based ansible/jinja.

Signed-off-by: Boris Ranto <branto@redhat.com>
roles/ceph-defaults/tasks/facts.yml

index c14f75797300c520e8edc26660740a30c8ed84b6..548eeb634b5b1bb539180e9863214458ed0bc42f 100644 (file)
 - name: set_fact rgw_hostname
   set_fact:
     rgw_hostname: "{% set _value = ansible_hostname -%}
-    {% for key in ceph_current_status['servicemap']['services']['rgw']['daemons'].keys() -%}
+    {% for key in (ceph_current_status['servicemap']['services']['rgw']['daemons'] | list) -%}
     {% if key == ansible_fqdn -%}
     {% set _value = key -%}
     {% endif -%}
   import_tasks: set_radosgw_address.yml
 
 - name: populate service facts
-  service_facts:
\ No newline at end of file
+  service_facts: