Use invenvtory_hosts in templates

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 :slight_smile:

Regards,
Sagayaraj

its double mustaches:

{{ ansible_hostanme }}

also make sure you have gathered facts.

thank you - that did the trick