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.
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.
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.
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.