How to make ansible not zip modules when uploading to remote nodes?

Hi,

When running ansible with ANSIBLE_KEEP_REMOTE_FILES=1, e.g.

ANSIBLE_KEEP_REMOTE_FILES=1 ansible-playbook -i c2, playbook.yml -vv -u root -k

and then looking at the uploaded files (~/.ansible/tmp/…), I see no module code in them, but I see statements like this:

ZIPDATA = “”“UEsDBBQA…AACmiQAAAAA=”“”

So most likely module code is zipped. Can I disable zipping?

Regards,
Yuri

no, you can’t. the payload that we’re shipping consists of both the module file and supporting code from ansible/module_utils. We need a way to ship all of these and putting them into a zip file seems to be the best way (someday we may be able to get python on the remote machine to execute the zip file natively. Right now we have to use a wrapper script because python-2.4, 2.6, 2.7, and 3.x all have different behaviours when trying to execute a zip file containing python code.

Most often when people use ANSIBLE_KEEP_REMOTE_FILES, they’re trying to debug the module code that’s executed on the remote machine. This section of the documentation: http://docs.ansible.com/ansible/dev_guide/developing_modules_best_practices.html#debugging-ansiblemodule-based-modules should have everything you need to turn the single file into a tree of code that you can debug on the remote machine.

Hope that helps!
-Toshio