Discussion:
[ansible-project] Use invenvtory_hosts in templates
Sagayaraj A
2015-07-28 11:55:00 UTC
Permalink
Hi All,

I'm trying to make use of the values in the inventory file to generate a
configuration file out a of a Jinja template. Similarly I'm not able to use
the ansible facts as well in the Jinja template (ex: { ansible_hostanme }
).

Is this supported/possible?
Is there something that I can do to make this work?

Appreciate your comments/help :)


Regards,
Sagayaraj
--
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 ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/46caf4e4-1c9f-4899-9516-33bdb978c03b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Brian Coca
2015-07-28 12:32:20 UTC
Permalink
its double mustaches:

{{ ansible_hostanme }}

also make sure you have gathered facts.
--
Brian Coca
--
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 ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8nxG2qRTo2OyZ%3DtumGVHepU2ZfFYwaR9vOZQBGPLjm__Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Sagayaraj A
2015-07-28 15:03:13 UTC
Permalink
thank you - that did the trick
Post by Brian Coca
{{ ansible_hostanme }}
also make sure you have gathered facts.
--
Brian Coca
--
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 ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/273a40ad-f5d5-41f1-8e69-240e94024069%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...