tenks/ansible/roles/wait-for-resources/tasks/main.yml
Radosław Piliszek aa922ad2f8 [ansible-lint] Unignore jinja[spacing]
Fix in one place, ignore in the other.

Only 4 warnings now.

Change-Id: I3c745914e2ffdcdd7e70d9e06ae1df05dc120f79
2022-09-10 09:11:28 +00:00

43 lines
1.3 KiB
YAML

---
# Waits for for the resource tracker to be updated with a given resource
# class
- name: Validate that the virtualenv variable is set
fail:
msg: >-
You must set the variable, wait_for_resources_venv, to use this role.
when: wait_for_resources_venv is none
- name: Validate resources
include_tasks: validate.yml
vars:
wait_for_resources_amount: "{{ item.amount }}"
wait_for_resources_resource_class: "{{ item.resource_class }}"
loop: "{{ wait_for_resources_required_resources }}"
- name: Copy over requirements file
copy:
src: requirements.txt
dest: "{{ wait_for_resources_python_requirements_path }}"
mode: preserve
- name: Install dependencies in supplied venv # noqa jinja[spacing]
pip:
requirements: "{{ wait_for_resources_python_requirements_path }}"
extra_args: >-
{%- if wait_for_resources_python_upper_constraints_url -%}
-c {{ wait_for_resources_python_upper_constraints_url }}
{%- endif -%}
virtualenv: "{{ wait_for_resources_venv }}"
register: result
until: result is success
retries: 3
- name: Call wait_for_resources module
wait_for_resources:
venv: "{{ wait_for_resources_venv }}"
resources: "{{ wait_for_resources_required_resources }}"
delay: "{{ wait_for_resources_delay | default(omit, true) }}"
maximum_retries: "{{ wait_for_resources_retry_limit }}"