]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
start_osds: Use list instead of keys
authorBoris Ranto <branto@redhat.com>
Mon, 19 Nov 2018 23:45:40 +0000 (00:45 +0100)
committerSébastien Han <seb@redhat.com>
Tue, 20 Nov 2018 17:48:22 +0000 (18:48 +0100)
If you use python3 based ansible then keys() returns a dict_keys object,
not a list of keys. This breaks the installation on such a system. Using
the list filter provides a more robust solution that should work on both
python2 and python3 based ansible. You can find some more information
about the issue, here:

https://github.com/ansible/ansible/issues/19514

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

index 1dba8c1e26a73298d487e1c2a568d3c81867b8fd..75349ad27c4cccbd4e2caff524e019135dd9b856 100644 (file)
@@ -54,7 +54,7 @@
     state: started
     enabled: yes
     daemon_reload: yes
-  with_items: "{{ devices if osd_scenario != 'lvm' else (ceph_osd_ids.stdout | from_json).keys() }}"
+  with_items: "{{ devices if osd_scenario != 'lvm' else (ceph_osd_ids.stdout | from_json | list) }}"
 
 - name: ensure systemd service override directory exists
   file:
@@ -72,4 +72,4 @@
     config_type: "ini"
   when:
     - ceph_osd_systemd_overrides is defined
-    - ansible_service_mgr == 'systemd'
\ No newline at end of file
+    - ansible_service_mgr == 'systemd'