I have a host file as such.
[my_dg1]
10.20.30.15
10.20.30.16
I am using the following jinja2 template
{% for host in groups['my_dg1'] %}
{{ host }} Hostname: {{device_facts.devices[0].hostname }}
{{ host }} Management IP: {{ private_ip }}
{% endfor %}
The private_ip and the hostname were captured using device facts
I am expecting to print
10.20.30.15 Hostname: test15.test.net
10.20.30.15 Management 10.20.30.15
10.20.30.16 Hostname: test16.test.net
10.20.30.16 Management IP: 10.20.30.16
Instead its printing
10.20.30.15 Hostname: test15.test.net
10.20.30.15 Management IP: 10.20.30.15
10.20.30.16 Hostname: test15.test.net
10.20.30.16 Management IP: 10.20.30.15
Thank you in advance for any help you can provide.