Extends check_devices tasks to non-collocated an lvm-batch scenarios

Tuned name of a task and error message to make it more user understandable

Fixes BZ 1648168 - ceph-validate : devices are not validated in non-collocated and lvm_batch scenario

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1648168

Signed-off-by: VasishtaShastry <vipin.indiasmg@gmail.com>
pull/3663/head
VasishtaShastry 2018-11-09 22:50:05 +05:30 committed by mergify[bot]
parent 038401fef2
commit 34c25ef49b
2 changed files with 18 additions and 15 deletions

View File

@ -1,17 +1,21 @@
--- ---
- name: validate devices is actually a device - name: devices validation
parted: block:
device: "{{ item }}" - name: validate devices is actually a device
unit: MiB parted:
register: devices_parted device: "{{ item }}"
with_items: "{{ devices }}" unit: MiB
register: devices_parted
with_items: "{{ devices }}"
- name: fail if one of the devices is not a device - name: fail if one of the devices is not a device
fail: fail:
msg: "{{ item }} is not a block special file!" msg: "{{ item }} is not a block special file!"
when:
- item.failed
with_items: "{{ devices_parted.results }}"
when: when:
- item.failed - devices is defined
with_items: "{{ devices_parted.results }}"
- name: validate dedicated_device is/are actually device(s) - name: validate dedicated_device is/are actually device(s)
parted: parted:
@ -30,9 +34,9 @@
- osd_scenario == 'non-collocated' - osd_scenario == 'non-collocated'
- item.failed - item.failed
- name: fail if dedicated_device is not the size length as devices - name: fail if number of dedicated_devices is not equal to number of devices
fail: fail:
msg: "dedicated_device lengtth must be identical to devices's length" msg: "Number of dedicated_devices must be equal to number of devices. dedicated_devices: {{ dedicated_devices | length }}, devices: {{ devices | length }}"
when: when:
- osd_scenario == 'non-collocated' - osd_scenario == 'non-collocated'
- dedicated_devices|length != devices|length - dedicated_devices|length != devices|length

View File

@ -61,7 +61,6 @@
when: when:
- osd_group_name in group_names - osd_group_name in group_names
- not osd_auto_discovery | default(False) - not osd_auto_discovery | default(False)
- osd_scenario != "lvm" and devices is not defined
- name: include check_eth_mon.yml - name: include check_eth_mon.yml
include_tasks: check_eth_mon.yml include_tasks: check_eth_mon.yml