tenks/ansible/roles/wait-for-resources/tasks/validate.yml
Will Szumski d4e7e58619 Wait for resources to become available
This will wait for any resources that are created to become available
before exiting the script. This allows you to avoid a race condition
where a server could be created before the resource tracker had been
updated with the new resources; server creation would fail.

Change-Id: I57f8c93cb1ebbc284b96ef1ced2c4edd59b27795
Story: 2004274
Task: 27823
Depends-On: https://review.openstack.org/617642
2018-11-19 16:40:43 +00:00

18 lines
539 B
YAML

---
- name: Validate that the target resource class is set
fail:
msg: >-
Each item in the dictionary wait_for_resources_required_resources must contain
the key, resource_class.
when: wait_for_resources_class is none
- name: Validate expected resource count
vars:
count: "{{ wait_for_resources_amount | int(default=-1) }}"
fail:
msg: >-
Each item in the dictionary wait_for_resources_required_resources must contain
the key, amount.
when: wait_for_resources_amount is none or count | int < 0