]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
osd: fix `set_fact build dedicated_devices` 2006/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 6 Oct 2017 12:35:42 +0000 (14:35 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 6 Oct 2017 13:00:32 +0000 (15:00 +0200)
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 <gabrioux@redhat.com>
roles/ceph-osd/tasks/check_devices.yml

index 339b8b9151c1b15c82e0d5ad48c3a70acf94c581..d4aaaa3382add34c6061a5d5d97371658df383fd 100644 (file)
 
 - 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'