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
parted:
device: "{{ item }}"
unit: MiB
register: devices_parted
with_items: "{{ devices }}"
- name: devices validation
block:
- name: validate devices is actually a device
parted:
device: "{{ item }}"
unit: MiB
register: devices_parted
with_items: "{{ devices }}"
- name: fail if one of the devices is not a device
fail:
msg: "{{ item }} is not a block special file!"
- 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 }}"
when:
- item.failed
with_items: "{{ devices_parted.results }}"
- devices is defined
- name: validate dedicated_device is/are actually device(s)
parted:
@ -30,9 +34,9 @@
- osd_scenario == 'non-collocated'
- 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:
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:
- osd_scenario == 'non-collocated'
- dedicated_devices|length != devices|length
- dedicated_devices|length != devices|length

View File

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