mirror of https://github.com/ceph/ceph-ansible.git
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>
(cherry picked from commit 34c25ef49b
)
pull/3666/head
parent
d1051c8e55
commit
2393d82306
|
@ -1,17 +1,21 @@
|
||||||
---
|
---
|
||||||
- name: validate devices is actually a device
|
- name: devices validation
|
||||||
|
block:
|
||||||
|
- name: validate devices is actually a device
|
||||||
parted:
|
parted:
|
||||||
device: "{{ item }}"
|
device: "{{ item }}"
|
||||||
unit: MiB
|
unit: MiB
|
||||||
register: devices_parted
|
register: devices_parted
|
||||||
with_items: "{{ devices }}"
|
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:
|
when:
|
||||||
- item.failed
|
- item.failed
|
||||||
with_items: "{{ devices_parted.results }}"
|
with_items: "{{ devices_parted.results }}"
|
||||||
|
when:
|
||||||
|
- devices is defined
|
||||||
|
|
||||||
- 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
|
|
@ -51,7 +51,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
|
||||||
|
|
Loading…
Reference in New Issue