Hey all,
Im trying to pull the hostname and ip of the hosts in a specific host group from the facts gathered when the ansibe playbook runs to gather it facts.
Im trying to use the hostname and ip for both my two target hosts to dynamically populate a haproxy config file using the jinja2 templating support
Ive got the templating working perfectly but i cannot find a way to reference these facts and interate over them within the template.
I know in the template we can do
{% for item in hosts %}
server name {{ host.name }} {{ host.ip }} check
{% endfor %}
How can i get the facts i need into either array or dictionary so i can iterate through them and populate the template.
Owen