Add more meaningful/user readable failure

Change-Id: I1651f0703afcc45ba1e514524033932e287dacf5
This commit is contained in:
Olivier Bourdon 2018-05-04 13:44:46 +02:00
parent 62d2211761
commit ba78028a0e

View File

@ -50,6 +50,16 @@
tags:
- check-disk-size
- name: Fail when disk can not be found
fail:
msg: |
Can not find disk {{ bootstrap_host_data_disk_device }}
when:
- bootstrap_host_data_disk_device != None
- ansible_devices.get(bootstrap_host_data_disk_device) == None
tags:
- check-disk-size
- name: Set data disk facts
set_fact:
host_data_disk_sectors: "{{ (ansible_devices[bootstrap_host_data_disk_device]['sectors'] | int) }}"