# ANSIBALLZ, zipped ansible library

**URL:** <https://forum.ansible.com/t/ansiballz-zipped-ansible-library/23124>\
**Category:** Ansible Developer\
**Created:** [November 28, 2016, 11:44pm UTC](https://forum.ansible.com/t/ansiballz-zipped-ansible-library/23124 "2016-11-28T23:44:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ted\_Timmons](https://avatars.discourse-cdn.com/v4/letter/t/9e8a1a/32.png) [@Ted\_Timmons](https://forum.ansible.com/u/Ted_Timmons)\
**Post date:** [November 28, 2016, 11:44pm UTC](https://forum.ansible.com/t/ansiballz-zipped-ansible-library/23124/1 "2016-11-28T23:44:51Z")

</div>

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](https://github.com/ansible/ansible/issues/15721)

-ted

---

<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:** [November 29, 2016, 1:31am UTC](https://forum.ansible.com/t/ansiballz-zipped-ansible-library/23124/2 "2016-11-29T01:31:44Z")

</div>

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](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-0273/)

[https://www.python.org/dev/peps/pep-0302/](https://www.python.org/dev/peps/pep-0302/)

---

<div class="post-metadata">

**Author:** ![Bryce\_Walter](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@Bryce\_Walter](https://forum.ansible.com/u/Bryce_Walter)\
**Post date:** [November 29, 2016, 7:43am UTC](https://forum.ansible.com/t/ansiballz-zipped-ansible-library/23124/3 "2016-11-29T07:43:22Z")

</div>

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

Bryce Walter
