---
# Checks if required credentials, if given, are actually present

- name: Fail if any of the credentials are missing
  when: lookup('env', _credential) == ''
  ansible.builtin.fail:
    msg: Credential "{{ _credential }}" is missing. Please add it to the job template.
  with_items: "{{ required_credentials }}"
  loop_control:
    loop_var: _credential
