# How to stop Ansible from cleaning up temporary files?

**URL:** <https://forum.ansible.com/t/how-to-stop-ansible-from-cleaning-up-temporary-files/21254>\
**Category:** Ansible Project\
**Created:** [April 25, 2016, 6:36am UTC](https://forum.ansible.com/t/how-to-stop-ansible-from-cleaning-up-temporary-files/21254 "2016-04-25T06:36:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Howard\_Guo](https://avatars.discourse-cdn.com/v4/letter/h/8edcca/32.png) [@Howard\_Guo](https://forum.ansible.com/u/Howard_Guo)\
**Post date:** [April 25, 2016, 6:36am UTC](https://forum.ansible.com/t/how-to-stop-ansible-from-cleaning-up-temporary-files/21254/1 "2016-04-25T06:36:36Z")

</div>

Hello!

I am debugging an Ansible playbook that throws an obscure error, the command from “-vvvv” output looks totally sane, but the SSH command does not carry useful information, it only invokes a temporary script locaed in ~/.ansible/tmp.

Unfortunately, when Ansible comes back with the error, ~/.ansible/tmp has already been cleaned up.

How to stop Ansible from cleaning up the tmp directory for this case?

Thanks.

Regards,  
Howard

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [April 25, 2016, 12:35pm UTC](https://forum.ansible.com/t/how-to-stop-ansible-from-cleaning-up-temporary-files/21254/2 "2016-04-25T12:35:18Z")

</div>

ANSIBLE\_KEEP\_REMOTE\_FILES=1 ansible-playbook -vvvv …
