Loop issue with nested variable and dict

Hi,

I am trying to do the following:

Consul-template needs to generate a haproxy config, the consul template i want to be dynamic filled with Ansible.
The consul template however is a Go template and unfortunately Go uses the brackets yaml uses. To be able to build a Go template ansible templates i am putting the Go syntax in a variable.

My whole idea is to place all applications that i want consul to generate templates for in a variable file, and let these variables be used in a template i generate to generate the Go template for consul.

I got most of it to work, except for the fact that the variable is looping over the template instead of within the template. I suspect i need to do it all different.

The task file main.yml:

I hit the exact same problem, and someone on IRC pointed me at {% raw
%}....{% endraw %}

http://jinja.pocoo.org/docs/dev/templates/#escaping

But that would leave alone my Go template language right? It wouldn’t solve the looping over instead of inside the template, am i correct?
Thank you for your answer! :slight_smile:

Issue solved. :slight_smile: