Ansible facts inside templates

Hi,

Could someone please point me to the proper way of using ansible facts inside templates?
I’m at latest devel and have the following content inside template:

{{ inventory_hostname }}
{{ ansible_hostname }}

With template action it results in just IP for first variable and empty ansible_hostname (other facts doesn’t work too)
Setup module correctly displays ansible_hostname during test run.

Thanks,
Dmitry

You need to tell me a bit more about your setup.

Can I see a snippet of your playbook? Have you disabled facts? What OS are you managing?

Thanks Michael, that was indeed disabled facts at the top of playbook. After enabling it all worked as expected.

Great! Glad it is all working!