2018-07-18 21:59:22 +08:00
---
2018-11-10 01:20:05 +08:00
- name : devices validation
block :
- name : validate devices is actually a device
parted :
device : "{{ item }}"
unit : MiB
register : devices_parted
with_items : "{{ devices }}"
2018-07-18 21:59:22 +08:00
2018-11-10 01:20:05 +08:00
- name : fail if one of the devices is not a device
fail :
msg : "{{ item }} is not a block special file!"
when :
- item.failed
with_items : "{{ devices_parted.results }}"
2018-07-18 21:59:22 +08:00
when :
2018-11-10 01:20:05 +08:00
- devices is defined
2018-07-18 21:59:22 +08:00
- name : validate dedicated_device is/are actually device(s)
parted :
device : "{{ item }}"
unit : MiB
register : dedicated_device_parted
2018-07-18 23:46:27 +08:00
with_items : "{{ dedicated_devices }}"
2018-07-18 21:59:22 +08:00
when :
- osd_scenario == 'non-collocated'
- 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 }}"
2018-07-18 23:46:27 +08:00
when :
- osd_scenario == 'non-collocated'
- item.failed
2018-07-18 21:59:22 +08:00
2018-11-10 01:20:05 +08:00
- name : fail if number of dedicated_devices is not equal to number of devices
2018-07-18 21:59:22 +08:00
fail :
2018-11-10 01:20:05 +08:00
msg : "Number of dedicated_devices must be equal to number of devices. dedicated_devices: {{ dedicated_devices | length }}, devices: {{ devices | length }}"
2018-07-18 21:59:22 +08:00
when :
- osd_scenario == 'non-collocated'
2018-11-10 01:20:05 +08:00
- dedicated_devices|length != devices|length