matching on facts in templates

22 views
Skip to first unread message

Barry Morrison

unread,
Oct 2, 2014, 6:39:44 PM10/2/14
to ansible...@googlegroups.com
I have some legacy servers, and I have some servers that aren't legacy and being built a new way with new network interfaces. 

The playbook/template worked matching on the old template and facts, but now that a new interface exists, I need to see if it it exists, and if it does, use it. 


And errors but -vvvv isn't clear what host(s) it's failing on. 

Is this supported in the template? Is the matching correct as far as hostvars[host]['ansible_br305'] or is there some other way to get at facts in a template? 

Thanks!

Barry Morrison

unread,
Oct 2, 2014, 7:13:22 PM10/2/14
to ansible...@googlegroups.com
I needed

{% if 'ansible_br305' in hostvars[hosts] %} and it works! 

Thanks. 
Reply all
Reply to author
Forward
0 new messages