I have a play that search for available storage in vm datastore to find disk space.
- name: Select the datastore which has minimum of 500GB
include_role: find_disk_space_datastore
with_item:
-datastore_001
-datastore_002
-datastore_003
Role: roles/find_disk_space_datastore/tasks/main.yml
- name: search for domain {{ item }}
blah ...blah save the free space on {{ disk_space }} variable
- name: find the datastore
setfact:
datastore_name:
when: {{ disk_space }} >> 500
Assume I have found free space in second item which is datastore_002 instead of going to datastore_003 in the loop how can I exit from there ?????
note - I need to break the loop in between.
thank you inadvanced