diff --git a/roles/ceph-validate/tasks/check_devices.yml b/roles/ceph-validate/tasks/check_devices.yml index 6d938499e..8b3286c5e 100644 --- a/roles/ceph-validate/tasks/check_devices.yml +++ b/roles/ceph-validate/tasks/check_devices.yml @@ -1,14 +1,17 @@ --- -- name: validate devices is actually a device - parted: - device: "{{ item }}" - unit: MiB - register: devices_parted - with_items: "{{ devices }}" +- name: devices validation + when: devices is defined + block: + - name: get devices information + parted: + device: "{{ item }}" + unit: MiB + register: devices_parted + failed_when: False + with_items: "{{ devices }}" -- 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 }}" + - name: fail if one of the devices is not a device + fail: + msg: "{{ item }} is not a block special file!" + when: item.rc is defined + with_items: "{{ devices_parted.results }}"