# Ansible leaving empty directories

**URL:** <https://forum.ansible.com/t/ansible-leaving-empty-directories/14289>\
**Category:** Ansible Project\
**Created:** [January 7, 2014, 5:04pm UTC](https://forum.ansible.com/t/ansible-leaving-empty-directories/14289 "2014-01-07T17:04:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anand\_Buddhdev2](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Anand\_Buddhdev2](https://forum.ansible.com/u/Anand_Buddhdev2)\
**Post date:** [January 7, 2014, 5:04pm UTC](https://forum.ansible.com/t/ansible-leaving-empty-directories/14289/1 "2014-01-07T17:04:32Z")

</div>

We’re using ansible 1.4.3 with the “local” connection type on our servers. We noticed recently that the inode usage on all our server was climbing steadily, and we’ve tracked it down to ansible leaving empty directories in /.ansible/tmp. The directories themselves are empty, because we have ANSIBLE\_KEEP\_REMOTE\_FILES set to false. But the directories keep accumulating. Shouldn’t ansible also remove the directories it creates, or is there a reason for leaving these directories around?

Anand

---

<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:** [January 7, 2014, 5:06pm UTC](https://forum.ansible.com/t/ansible-leaving-empty-directories/14289/2 "2014-01-07T17:06:23Z")

</div>

Do you have any async tasks?

We have an open ticket to look into this currently for some related bits.

(ANSIBLE\_KEEP\_REMOTE\_FILES for the benefit of others is only a debug setting that people shouldn’t really need to know about)

---

<div class="post-metadata">

**Author:** ![Anand\_Buddhdev2](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Anand\_Buddhdev2](https://forum.ansible.com/u/Anand_Buddhdev2)\
**Post date:** [January 7, 2014, 5:10pm UTC](https://forum.ansible.com/t/ansible-leaving-empty-directories/14289/3 "2014-01-07T17:10:38Z")

</div>

As far as I can see, we don’t have any async tasks. Everything runs in order, and ansible waits for each task to complete before moving on.

The default for ANSIBLE\_KEEP\_REMOTE\_FILES is true, which is why I had to set it to false for our ansible-managed hosts. With it set to true, not only were the directories being left, but they had files in them too.

---

<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:** [January 7, 2014, 5:21pm UTC](https://forum.ansible.com/t/ansible-leaving-empty-directories/14289/4 "2014-01-07T17:21:11Z")

</div>

Ok, thanks, the ticket is currently open here:

[https://github.com/ansible/ansible/issues/5339](https://github.com/ansible/ansible/issues/5339)
