mirror of https://github.com/ceph/ceph-ansible.git
validate: fail in check_devices at the right task
see https://bugzilla.redhat.com/show_bug.cgi?id=1648168#c17 for details.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1648168#c17
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 771648304d
)
pull/4079/head
parent
12651433ba
commit
d36bab5557
|
@ -1,14 +1,17 @@
|
||||||
---
|
---
|
||||||
- name: validate devices is actually a device
|
- name: devices validation
|
||||||
|
when: devices is defined
|
||||||
|
block:
|
||||||
|
- name: get devices information
|
||||||
parted:
|
parted:
|
||||||
device: "{{ item }}"
|
device: "{{ item }}"
|
||||||
unit: MiB
|
unit: MiB
|
||||||
register: devices_parted
|
register: devices_parted
|
||||||
|
failed_when: False
|
||||||
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.rc is defined
|
||||||
- item.failed
|
|
||||||
with_items: "{{ devices_parted.results }}"
|
with_items: "{{ devices_parted.results }}"
|
||||||
|
|
Loading…
Reference in New Issue