# empty ansible.cfg in current directory changes the action of ansible-playbook ?

**URL:** <https://forum.ansible.com/t/empty-ansible-cfg-in-current-directory-changes-the-action-of-ansible-playbook/18739>\
**Category:** Ansible Project\
**Created:** [July 13, 2015, 6:05am UTC](https://forum.ansible.com/t/empty-ansible-cfg-in-current-directory-changes-the-action-of-ansible-playbook/18739 "2015-07-13T06:05:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oliver\_markey](https://avatars.discourse-cdn.com/v4/letter/o/a587f6/32.png) [@Oliver\_markey](https://forum.ansible.com/u/Oliver_markey)\
**Post date:** [July 13, 2015, 6:05am UTC](https://forum.ansible.com/t/empty-ansible-cfg-in-current-directory-changes-the-action-of-ansible-playbook/18739/1 "2015-07-13T06:05:21Z")

</div>

I create a simple playbook to restart rsyslog using service module.

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [July 13, 2015, 2:33pm UTC](https://forum.ansible.com/t/empty-ansible-cfg-in-current-directory-changes-the-action-of-ansible-playbook/18739/2 "2015-07-13T14:33:59Z")

</div>

Ansible needs a well configured ansible.cfg to work reliably. I don’t think it will fallback on defaults for everything it needs.

At least the inventory needs to be set properly.

If there is one in the current directory, it will use that, so if you make that empty, it will just miss a lot of settings it needs.

What is your point by creating an empty ansible.cfg?

---

<div class="post-metadata">

**Author:** ![Oliver\_markey](https://avatars.discourse-cdn.com/v4/letter/o/a587f6/32.png) [@Oliver\_markey](https://forum.ansible.com/u/Oliver_markey)\
**Post date:** [July 14, 2015, 1:33am UTC](https://forum.ansible.com/t/empty-ansible-cfg-in-current-directory-changes-the-action-of-ansible-playbook/18739/3 "2015-07-14T01:33:11Z")

</div>

Thanks, You are right. At first, I just created a ansible.cfg in my work dir to add some custom configuration in.  
When I found this problem, I thouth it would be someting wrong in my ansible.cfg. So I tested it by commented lines one by one.  
After all lines are commnted, the problem was still there with an empty ansible.cfg file 🙂

在 2015年7月13日星期一 UTC+8下午10:34:25，Serge van Ginderachter写道：
