I have template that contains
`
- job_name: nodes
consul_sd_configs:
{% for cenv in prometheus_consul_dcs %}
{% endfor %}
`
This loads fine with
`
prometheus_yml: “{{lookup(‘template’, ‘…/files/prometheus/prometheus.yml.j2’)}}”
`
But when I add a loop
`
- job_name: nodes
consul_sd_configs:
{% for cenv in prometheus_consul_dcs %}
{% endfor %}
`
I get an error saying the file can’t read.
`
TASK: [prometheus | Create prometheus configuration file] *********************
fatal: [10.0.196.193] => Failed to template {{lookup(‘template’, ‘…/files/prometheus/prometheus.yml.j2’)}}: unable to read /Users/bkaplan/si/ops/ansible/roles/prometheus/files/prometheus/prometheus.yml.j2
`
I guess one could argue that “can’t read” is not the same as “can’t find” and this should be interpreted as an error in the file. Is there any way to get the actual error from jinja?