# keeping ansiballz uncompressed files

**URL:** <https://forum.ansible.com/t/keeping-ansiballz-uncompressed-files/22574>\
**Category:** Ansible Developer\
**Created:** [September 17, 2016, 12:44am UTC](https://forum.ansible.com/t/keeping-ansiballz-uncompressed-files/22574 "2016-09-17T00:44:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim1](https://avatars.discourse-cdn.com/v4/letter/t/b782af/32.png) [@Tim1](https://forum.ansible.com/u/Tim1)\
**Post date:** [September 17, 2016, 12:44am UTC](https://forum.ansible.com/t/keeping-ansiballz-uncompressed-files/22574/1 "2016-09-17T00:44:35Z")

</div>

hey folks,

I was wondering if someone might know of a way to keep the uncompressed ansiballz code around without deleting it or editing the ansible source?

I specify ANSIBLE\_KEEP\_REMOTE\_FILES, and that keeps around the module in its compressed state that I later can run “python /some/module/here.py explode” on to get to the code, but I’m interested in seeing the files as they exist when run.

Something is creating them on my box (for example) at this location.

/private/var/folders/jc/9d1188j962931rhqrlm4173w5j5m45/T/ansible\_cknQdU/ansible\_modlib.zip/ansible/module\_utils/six.py

When I use explode, it puts them at

/Users/trupp/.ansible/tmp/ansible-tmp-1474071763.24-173540062068376/debug\_dir

And refers to this location in the -vvvv output

/Users/trupp/.ansible/tmp/ansible-tmp-1474071763.24-173540062068376/some\_module.py

Thanks,  
tim

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [September 18, 2016, 4:38pm UTC](https://forum.ansible.com/t/keeping-ansiballz-uncompressed-files/22574/2 "2016-09-18T16:38:05Z")

</div>

> hey folks,
> 
> I was wondering if someone might know of a way to keep the uncompressed ansiballz code around without deleting it or editing the ansible source?
> 
> I specify ANSIBLE\_KEEP\_REMOTE\_FILES, and that keeps around the module in its compressed state that I later can run “python /some/module/here.py explode” on to get to the code, but I’m interested in seeing the files as they exist when run.
> 
> Something is creating them on my box (for example) at this location.
> 
> /private/var/folders/jc/9d1188j962931rhqrlm4173w5j5m45/T/ansible\_cknQdU/ansible\_modlib.zip/ansible/module\_utils/six.py

The files are not exploded but run directly from the ansible\_modlib.zip zipfile. The module file itself is the only thing extracted from the zip file (because I could find no portable way to invoke that from the zipfile on all of python-2.4, python-2.6, and python-2.7+). The zipfile is cleaned up as well but if you want access to it (rather than the base64 string that’s in the ansiball itself) then what I do is use ANSIBLE\_KEEP\_REMOTE\_FILES to keep the ansiball. Then edit the ansiball to keep it around. replace the call to shutil.rmtree(temp\_path) with print(temp\_path). You can then find the ansible\_modlib.zip and script in the temp\_path directory.

If you have more questions, feel free to ping me on IRC. I’m abadger1999 there and #ansible-devel is the best place to find me.

-Toshio

---

<div class="post-metadata">

**Author:** ![Tim1](https://avatars.discourse-cdn.com/v4/letter/t/b782af/32.png) [@Tim1](https://forum.ansible.com/u/Tim1)\
**Post date:** [September 18, 2016, 5:25pm UTC](https://forum.ansible.com/t/keeping-ansiballz-uncompressed-files/22574/3 "2016-09-18T17:25:08Z")

</div>

Cool. Thanks Toshio. I was mousing around the code and saw exactly what you mentioned, that the module itself is extracted. I think this is what I was looking to do, so I think I’m covered.

Thanks!  
-tim
