# Checking ansible-playbook is using the right configuration

**URL:** <https://forum.ansible.com/t/checking-ansible-playbook-is-using-the-right-configuration/13464>\
**Category:** Ansible Project\
**Created:** [September 12, 2013, 10:28am UTC](https://forum.ansible.com/t/checking-ansible-playbook-is-using-the-right-configuration/13464 "2013-09-12T10:28:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Nick](https://forum.ansible.com/u/Nick)\
**Post date:** [September 12, 2013, 10:28am UTC](https://forum.ansible.com/t/checking-ansible-playbook-is-using-the-right-configuration/13464/1 "2013-09-12T10:28:36Z")

</div>

Hi,

I'm trying to work out why ansible doesn't seem to be respecting the settings in $PWD/ansible.cfg (specifically error\_on\_undefined\_vars = True).

Is there some way of asking ansible-playbook to show me what it thinks its configuration is?

Thanks

N

---

<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:** [September 12, 2013, 5:49pm UTC](https://forum.ansible.com/t/checking-ansible-playbook-is-using-the-right-configuration/13464/2 "2013-09-12T17:49:21Z")

</div>

No, there’s not a way to show this.

What version of Ansible are you using by the way?

May help us look further.

---

<div class="post-metadata">

**Author:** ![Nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Nick](https://forum.ansible.com/u/Nick)\
**Post date:** [September 12, 2013, 8:58pm UTC](https://forum.ansible.com/t/checking-ansible-playbook-is-using-the-right-configuration/13464/3 "2013-09-12T20:58:23Z")

</div>

ansible-playbook --version

ansible-playbook 1.3 (devel 7c8aa669cf) last updated 2013/09/10 17:48:04 (GMT +100)

N

---

<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:** [September 13, 2013, 12:18am UTC](https://forum.ansible.com/t/checking-ansible-playbook-is-using-the-right-configuration/13464/4 "2013-09-13T00:18:58Z")

</div>

I can’t reproduce this, our “make tests” target uses local configurations for several of the tests it runs, so if this were an issue I’d expect to see tests fail. If you move your /etc/ansible/ansible.cfg to a different name, does it respect the local copy? Also, are you running ansible commands via sudo?

---

<div class="post-metadata">

**Author:** ![Nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Nick](https://forum.ansible.com/u/Nick)\
**Post date:** [September 13, 2013, 10:22am UTC](https://forum.ansible.com/t/checking-ansible-playbook-is-using-the-right-configuration/13464/5 "2013-09-13T10:22:11Z")

</div>

Not with sudo, no. And I’m running from a git checkout, so there is no /etc/ansible/ansible.cfg. Nor is there a ~/.ansible.cfg, and $ANSIBLE\_CFG is not set. The odd thing is - IIRC - that I believe that variable merging is on. I didn’t think that was on by default. So my .cfg appears to be affecting the behaviour. An experiment suggests that dollar variables are checked but brace variables are. Since I am converting old playbooks to the new syntax and trying to pin down another oddity, I think that may be the cause of my confusion. For example: “ansible-playbook -l localhost -c local test.yml” outputs: Thanks, N ps One comment - documentation for ansible.cfg is a bit hard to track down. The main mention seems to be here - itself not somewhere I’d think to look first: but the information about the configuration parameters which exist seem to be spread around in the docs in places you can only find if you know where to look. To find the exact name for the error\_on\_undefined\_vars parameter I needed to google for what I wanted and then reading a git pull request thread. Without checking the source I guess it’s possible that information is out of date. In addition, mis-spelling a parameter is easy and apparently generates no warnings, I’ve done that before. A valuable feature would be if Ansible told me when I if screwed one up.

---

<div class="post-metadata">

**Author:** ![Nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Nick](https://forum.ansible.com/u/Nick)\
**Post date:** [September 13, 2013, 10:57am UTC](https://forum.ansible.com/t/checking-ansible-playbook-is-using-the-right-configuration/13464/6 "2013-09-13T10:57:34Z")

</div>

Actually, after some more checks it seems there is more to this, but I’ll elaborate in a more appropriate thread, “When dollar variables are still necessary”

---

<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:** [September 13, 2013, 1:36pm UTC](https://forum.ansible.com/t/checking-ansible-playbook-is-using-the-right-configuration/13464/7 "2013-09-13T13:36:22Z")

</div>

They aren’t necessary in your case, see the other thread.

They are still useful when making references inside other datastructures (arather rare thing) and we’ll have a syntax for this.
