# How to make Ansible show error when using undeclared vars in template?

**URL:** <https://forum.ansible.com/t/how-to-make-ansible-show-error-when-using-undeclared-vars-in-template/13281>\
**Category:** Ansible Project\
**Created:** [August 11, 2013, 5:00am UTC](https://forum.ansible.com/t/how-to-make-ansible-show-error-when-using-undeclared-vars-in-template/13281 "2013-08-11T05:00:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![howachen](https://avatars.discourse-cdn.com/v4/letter/h/54ee81/32.png) [@howachen](https://forum.ansible.com/u/howachen)\
**Post date:** [August 11, 2013, 5:00am UTC](https://forum.ansible.com/t/how-to-make-ansible-show-error-when-using-undeclared-vars-in-template/13281/1 "2013-08-11T05:00:50Z")

</div>

We want it to show error rather than silently using an empty value.

Is it possible?

Thanks

---

<div class="post-metadata">

**Author:** ![benno\_joy](https://avatars.discourse-cdn.com/v4/letter/b/73ab20/32.png) [@benno\_joy](https://forum.ansible.com/u/benno_joy)\
**Post date:** [August 11, 2013, 5:08am UTC](https://forum.ansible.com/t/how-to-make-ansible-show-error-when-using-undeclared-vars-in-template/13281/2 "2013-08-11T05:08:51Z")

</div>

you can set error\_on\_undefined\_vars to true to get the desired functionality,

- Benno

---

<div class="post-metadata">

**Author:** ![howachen](https://avatars.discourse-cdn.com/v4/letter/h/54ee81/32.png) [@howachen](https://forum.ansible.com/u/howachen)\
**Post date:** [August 11, 2013, 10:43am UTC](https://forum.ansible.com/t/how-to-make-ansible-show-error-when-using-undeclared-vars-in-template/13281/3 "2013-08-11T10:43:26Z")

</div>

I cannot find any doc related to this “error\_on\_undefined\_vars” in official site, is it released?

Also, where to put? I tried ~/.ansible.cfg but not working…

Thanks.

---

<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:** [August 11, 2013, 12:08pm UTC](https://forum.ansible.com/t/how-to-make-ansible-show-error-when-using-undeclared-vars-in-template/13281/4 "2013-08-11T12:08:05Z")

</div>

It’s in the default examples/ansible.cfg (see checkout) that is packaged as /etc/ansible/ansible.cfg in most package distributions of Ansible.

This feature is also available only in 1.3 (currently under development) and later, and will be _default on_ very soon in 1.3.

–Michael
