]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
validate: only check device when they are devices
authorSébastien Han <seb@redhat.com>
Fri, 12 Oct 2018 16:32:40 +0000 (18:32 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Thu, 11 Apr 2019 15:57:02 +0000 (11:57 -0400)
We only validate the devices that are passed if there is a list of
devices to validate.

Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-validate/tasks/check_devices.yml
roles/ceph-validate/tasks/main.yml

index 7e0803cafa0246c34c03e26f817138c33f7de65e..884f11d454dbf06ef8c2052313dd8dce4bcfaad9 100644 (file)
   register: dedicated_device_parted
   with_items: "{{ dedicated_devices }}"
   when:
-    - osd_scenario == 'non-collocated'
+    - dedicated_devices|default([]) | length > 0
 
 - name: fail if one of the dedicated_device is not a device
   fail:
     msg: "{{ item }} is not a block special file!"
   with_items: "{{ dedicated_device_parted.results }}"
   when:
-    - osd_scenario == 'non-collocated'
+    - dedicated_devices|default([]) | length > 0
     - item.failed
 
 - name: fail if number of dedicated_devices is not equal to number of devices
   fail:
     msg: "Number of dedicated_devices must be equal to number of devices. dedicated_devices: {{ dedicated_devices | length }}, devices: {{ devices | length }}"
   when:
-    - osd_scenario == 'non-collocated'
-    - dedicated_devices|length != devices|length
+    - dedicated_devices|default([]) | length > 0
+    - devices | length > 0
+    - dedicated_devices | length != devices | length
\ No newline at end of file
index 49761bd16e9c63789dce26eb38c0f970b2bed86b..1c3ea4bfce03058141087edf6123ef5e2ae470ed 100644 (file)
@@ -61,6 +61,7 @@
   when:
     - osd_group_name in group_names
     - not osd_auto_discovery | default(False)
+    - devices|default([])|length > 0
 
 - name: include check_eth_mon.yml
   include_tasks: check_eth_mon.yml