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?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/361f9f6e-509e-4ccf-836d-2c96a9d1152b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to