2018-07-18 21:59:22 +08:00
|
|
|
---
|
2019-04-11 16:08:22 +08:00
|
|
|
- name: validate devices is actually a device
|
2018-07-18 21:59:22 +08:00
|
|
|
parted:
|
|
|
|
device: "{{ item }}"
|
|
|
|
unit: MiB
|
2019-04-11 16:08:22 +08:00
|
|
|
register: devices_parted
|
|
|
|
with_items: "{{ devices }}"
|
2018-07-18 21:59:22 +08:00
|
|
|
|
2019-04-11 16:08:22 +08:00
|
|
|
- name: fail if one of the devices is not a device
|
2018-07-18 21:59:22 +08:00
|
|
|
fail:
|
|
|
|
msg: "{{ item }} is not a block special file!"
|
2018-07-18 23:46:27 +08:00
|
|
|
when:
|
|
|
|
- item.failed
|
2019-04-11 16:08:22 +08:00
|
|
|
with_items: "{{ devices_parted.results }}"
|