ANSIBALLZ, zipped ansible library

ANSIBALLZ puts a compressed zip blob on the remote machine. It seems that python can read a compressed library? I mean, it isn’t exploded, yet it works.

This is relevant because it fails on pypy, which means coreos machines are unusable (since 2.1.0). If I duplicate the logic from ‘debug:explode’ into the main func of module_common, it works.

This is talked about, partially, in this:
https://github.com/ansible/ansible/issues/15721

-ted

From the issue you link, It looks like this is due to trying to use toolbox to run python on coreos. I believe this is due to having a shell script at /opt/bin/python that tries to execute /usr/bin/python inside of the toolbox container:

core@coreos ~ $ /opt/bin/python -c ‘import sys; print sys.executable’
/usr/bin/python

I believe that is the problem where the reports of “No such file or directory” are coming from. The “python” path on the coreos machine is in a different location than the actual python binary in the toolbox container, so when /opt/bin/python is executed in the container, it fails.

In a simple test to see if this could be resolved, I linked /usr/bin/python to /opt/bin/python inside the toolbox container, and it resolves the issues:

$ toolbox --quiet /bin/sh
/bin/sh: can’t access tty; job control turned off
/ # mkdir -p /opt/bin
/ # ln -s /usr/bin/python /opt/bin/

On the other hand, using the coreos instructions for installing pypy via https://github.com/defunctzombie/ansible-coreos-bootstrap work like a charm with ansible, with no complexities.

As for python being able to use a zipped file for imports, that is built in functionality of python:

https://www.python.org/dev/peps/pep-0273/

https://www.python.org/dev/peps/pep-0302/

+1 for defunct’s bootstrap. Works like a charm.

Bryce Walter