root@9ba2749b80b0:/code# python2Python 2.7.12 (default, Nov 17 2016, 22:18:11) [GCC 4.9.2] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import libvirt>>> root@9ba2749b80b0:/code# hacking/test-module -m lib/ansible/modules/extras/cloud/misc/virt.py * including generated source, if any, saving to: /root/.ansible_module_generated* ansiballz module detected; extracted module source to: /root/debug_dir***********************************RAW OUTPUT
{"msg": "The `libvirt` module is not importable. Check the requirements.", "failed": true, "invocation": {"module_args": {"xml": null, "state": null, "command": null, "name": null, "uri": "qemu:///system"}}}
***********************************PARSED OUTPUT{ "failed": true, "invocation": { "module_args": { "command": null, "name": null, "state": null, "uri": "qemu:///system", "xml": null } }, "msg": "The `libvirt` module is not importable. Check the requirements."}root@939639e10ec5:/code# which python
/usr/local/bin/python
root@939639e10ec5:/code# python
Python 2.7.12 (default, Nov 17 2016, 22:18:11)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
root@939639e10ec5:/code# env python
Python 2.7.12 (default, Nov 17 2016, 22:18:11)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
root@939639e10ec5:/code#FROM python:2
RUN pip install paramiko PyYAML Jinja2 httplib2 six
RUN apt-get update && apt-get install -y libvirt-dev \ && pip install libvirt-pythonRUN pip install boto boto3
VOLUME /codeWORKDIR /code
VOLUME /data
CMD ["bash"]root@c52acee259c9:/code# ansible localhost -m setup -a filter=ansible_env [WARNING]: Host file not found: /etc/ansible/hosts
[WARNING]: provided hosts list is empty, only localhost is available
localhost | SUCCESS => { "ansible_facts": { "ansible_env": { "ANSIBLE_HOME": "/code", "GPG_KEY": "C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF", "HOME": "/root", "HOSTNAME": "c52acee259c9", "LANG": "C.UTF-8", "MANPATH": "/code/docs/man:", "PATH": "/code/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "PWD": "/code", "PYTHONPATH": "/code/lib:", "PYTHON_PIP_VERSION": "9.0.1", "PYTHON_VERSION": "2.7.12", "SHLVL": "1", "TERM": "xterm", "_": "/code/bin/ansible" } }, "changed": false}