# troubles accessing .ansible.cfg vars in jinja templates

**URL:** <https://forum.ansible.com/t/troubles-accessing-ansible-cfg-vars-in-jinja-templates/13683>\
**Category:** Ansible Project\
**Created:** [October 15, 2013, 3:57pm UTC](https://forum.ansible.com/t/troubles-accessing-ansible-cfg-vars-in-jinja-templates/13683 "2013-10-15T15:57:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kesten\_Broughton2](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@Kesten\_Broughton2](https://forum.ansible.com/u/Kesten_Broughton2)\
**Post date:** [October 15, 2013, 3:57pm UTC](https://forum.ansible.com/t/troubles-accessing-ansible-cfg-vars-in-jinja-templates/13683/1 "2013-10-15T15:57:19Z")

</div>

I’ve posted a gist:  
[https://gist.github.com/darKoram/6993766](https://gist.github.com/darKoram/6993766)

---

<div class="post-metadata">

**Author:** ![James\_Cammarata1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@James\_Cammarata1](https://forum.ansible.com/u/James_Cammarata1)\
**Post date:** [October 15, 2013, 4:49pm UTC](https://forum.ansible.com/t/troubles-accessing-ansible-cfg-vars-in-jinja-templates/13683/2 "2013-10-15T16:49:19Z")

</div>

The ansible\_managed variable is a special variable passed through to templates, the other configuration settings are not.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 15, 2013, 6:25pm UTC](https://forum.ansible.com/t/troubles-accessing-ansible-cfg-vars-in-jinja-templates/13683/3 "2013-10-15T18:25:53Z")

</div>

The configuration setting “hostfile” isn’t surfaced to templates as an output variable.

This is actually true of most configuration settings.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 15, 2013, 6:26pm UTC](https://forum.ansible.com/t/troubles-accessing-ansible-cfg-vars-in-jinja-templates/13683/4 "2013-10-15T18:26:03Z")

</div>

Also, what James said 🙂
