Ansible

Ansible

Made by DeepSource

Referenced files must exist ANS-E5005

Bug risk
Minor

All files referenced by by include or import_tasks must exist. The check excludes files with jinja2 templates in the filename.

Example :

  • When include is being used:
---
- hosts: webservers
  vars:
    varset: varset
  tasks:
    - include: nestedincludes.yml tags=nested
    - include: "{{ varnotset }}.yml"
    - include: "{{ varset }}.yml"
    - include: "directory with spaces/main.yml"
  • When import_tasks is being used :
---
- hosts: webservers
  vars:
    varset: varset
  tasks:
    - import_tasks: nestedincludes.yml tags=nested
    - import_tasks: "{{ varnotset }}.yml"
    - import_tasks: "{{ varset }}.yml"
    - import_tasks: "directory with spaces/main.yml"