Skip to content

Commit

Permalink
tests: fail if there are not enough disks for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
yontalcar committed Oct 22, 2019
1 parent 4dc65f6 commit 4b1d9d5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/get_unused_disk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
unused_disks: "{{ unused_disks_return.disks }}"
when: "'Unable to find unused disk' not in unused_disks_return.disks"

- block:
- name: Exit playbook when there's not enough unused disks in the system
debug:
msg: "Unable to find enough unused disks. Exiting playbook."
- meta: end_play
- name: Exit playbook when there's not enough unused disks in the system
fail:
msg: "Unable to find enough unused disks. Exiting playbook."
when: unused_disks is undefined or unused_disks|length < disks_needed|default(1)

- name: Print unused disks
Expand Down

0 comments on commit 4b1d9d5

Please sign in to comment.