Commit 2888c082 authored by Sébastien Han's avatar Sébastien Han Committed by Dimitri Savineau
Browse files

validate: only check device when they are devices



We only validate the devices that are passed if there is a list of
devices to validate.
Signed-off-by: default avatarSébastien Han <seb@redhat.com>
parent 72211d4a
......@@ -24,19 +24,20 @@
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
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment