From ba78028a0e8aa3b8f5c6c4e2467e6fe2b47c6237 Mon Sep 17 00:00:00 2001 From: Olivier Bourdon Date: Fri, 4 May 2018 13:44:46 +0200 Subject: [PATCH] Add more meaningful/user readable failure Change-Id: I1651f0703afcc45ba1e514524033932e287dacf5 --- .../roles/bootstrap-host/tasks/check-requirements.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/roles/bootstrap-host/tasks/check-requirements.yml b/tests/roles/bootstrap-host/tasks/check-requirements.yml index 5f10aa5b8c..99afb5e388 100644 --- a/tests/roles/bootstrap-host/tasks/check-requirements.yml +++ b/tests/roles/bootstrap-host/tasks/check-requirements.yml @@ -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) }}"