Ansible include files

Hi All,

Would appreciate any help on this one

I have 3 files in the /include directory and i’d like to be able to call/use these from any role.

However, hard as i try can’t get the path to find the include files

If i add this line in a template {% include “…/…/include/jpr_syslog.j2” %} in the /roles/ex3400/templates/ex3400_template_v1.0.j2

I get this

TASK [ex3400 : Generate BSL Single EX3400 Build Config] ************************
fatal: [ex3400_1]: FAILED! => {“changed”: false, “failed”: true, “msg”: “TemplateNotFound: …/…/include/jpr_syslog.j2”}

├── group_vars
│ └── small_office_vars
├── host_vars
│ ├── ex3400_1
│ └── srx_1
├── include
│ ├── jpr_snmp.j2
│ ├── jpr_syslog.j2
│ └── jpr_tacacs.j2
├── roles
│ ├── ex3400
│ │ ├── output
│ │ │ └── ex3400_1.2.txt
│ │ ├── tasks
│ │ │ ├── ex3400_build.yml
│ │ │ └── main.yml
│ │ └── templates
│ │ └── ex3400_template_v1.0.j2
│ ├── single_srx
│ │ ├── output
│ │ │ └── srx_1.0.txt
│ │ ├── tasks
│ │ │ ├── main.yml
│ │ │ └── single_srx_build.yml
│ │ └── templates
│ │ └── srx_template_v1.0.j2

Cheers
Rich

Use relative from where you run ansible-playbook so probably

{% include "include/jpr_syslog.j2" %}