Hi,

having a jinja loop

{% for host in groups['server_group'] %} --dns={{ 
hostvars[host]['ansible_eth0']['ipv4']['address'] }} {% endfor %}

i want to change "eth0" with a group_var as the interface some times 
differs. I know i could do a "ansible_eth1" in the template but i had to do 
this in a lot of places so i thought using group_var (interface) would be 
ok.

I tried {% for host in groups['server_group'] %} --dns={{ 
hostvars[host]['ansible_{{interface}}']['ipv4']['address'] }} {% endfor %}

and a lot of other but always ended with a error. How can i use a group_var 
inside of this loop?


Cheers,

Mike

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0f7ccc56-4dec-42d6-8d40-552f1a96e191%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to