2018-07-18 21:59:22 +08:00
|
|
|
---
|
2019-06-07 16:50:28 +08:00
|
|
|
- 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 }}"
|
2018-07-18 21:59:22 +08:00
|
|
|
|
2019-06-07 16:50:28 +08:00
|
|
|
- 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 }}"
|