From: Guillaume Abrioux Date: Fri, 6 Oct 2017 12:35:42 +0000 (+0200) Subject: osd: fix `set_fact build dedicated_devices` X-Git-Tag: v3.0.0rc18~6^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6b027557e6974bde86f05704c0ad12bfcf66fd3a;p=ceph-ansible.git osd: fix `set_fact build dedicated_devices` Use an intermediate variable to build the final `dedicated_devices` list to avoid duplicate entry in that array. (We need a 1:1 relation between `dedicated_devices` and `devices` since we are using a `with_together` later. Signed-off-by: Guillaume Abrioux --- diff --git a/roles/ceph-osd/tasks/check_devices.yml b/roles/ceph-osd/tasks/check_devices.yml index 339b8b915..d4aaaa338 100644 --- a/roles/ceph-osd/tasks/check_devices.yml +++ b/roles/ceph-osd/tasks/check_devices.yml @@ -20,14 +20,14 @@ - name: set_fact build dedicated_devices from resolved symlinks set_fact: - dedicated_devices: "{{ dedicated_devices | default([]) + [ item.stdout ] }}" + dedicated_devices_tmp: "{{ dedicated_devices_tmp | default([]) + [ item.stdout ] }}" with_items: "{{ dedicated_devices_prepare_canonicalize.results }}" when: - osd_scenario == 'non-collocated' - name: set_fact build final dedicated_devices list set_fact: - dedicated_devices: "{{ dedicated_devices | reject('search','/dev/disk') | list }}" + dedicated_devices: "{{ dedicated_devices_tmp | reject('search','/dev/disk') | list }}" when: - osd_scenario == 'non-collocated'