From 2393d823066b7a9d4d2fa2db7c936c46af3f338b Mon Sep 17 00:00:00 2001 From: VasishtaShastry Date: Fri, 9 Nov 2018 22:50:05 +0530 Subject: [PATCH] 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 (cherry picked from commit 34c25ef49b10ef6c789447e785a4bf6938c2a804) --- roles/ceph-validate/tasks/check_devices.yml | 32 ++++++++++++--------- roles/ceph-validate/tasks/main.yml | 1 - 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/roles/ceph-validate/tasks/check_devices.yml b/roles/ceph-validate/tasks/check_devices.yml index d35c1aae6..a8122021c 100644 --- a/roles/ceph-validate/tasks/check_devices.yml +++ b/roles/ceph-validate/tasks/check_devices.yml @@ -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 \ No newline at end of file + - dedicated_devices|length != devices|length diff --git a/roles/ceph-validate/tasks/main.yml b/roles/ceph-validate/tasks/main.yml index 6efab8170..199781f17 100644 --- a/roles/ceph-validate/tasks/main.yml +++ b/roles/ceph-validate/tasks/main.yml @@ -51,7 +51,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 -- 2.39.5