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: