Docker module error

572 views
Skip to first unread message

idemia pune

unread,
May 17, 2019, 2:49:01 AM5/17/19
to Ansible Project
Hi,

Please help to get this resolved, tried all most everything.

Ansible Version:

ansible 2.7.10

  config file = /etc/ansible/ansible.cfg

  configured module search path = ['/home/stack/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']

  ansible python module location = /home/stack/.local/lib/python3.6/site-packages/ansible

  executable location = /home/stack/.local/bin/ansible

  python version = 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0]


List


ll drop support for Python 2.7.

docker-compose                1.9.0      

docker-py                     1.10.6     

docker-pycreds                0.4.0      

dockerpty                     0.4.1  




 python --version


Python 2.7.15rc1


Error

FAILED! => {"changed": false, "msg": "Failed to import docker or docker-py - No module named requests.exceptions. Try `pip install docker` or `pip install docker-py` (Python 2.6)"}


FAILED! => {"changed": false, "msg": "Failed to import docker or docker-py - No module named docker. Try `pip install docker` or `pip install docker-py` (Python 2.6)"}




Daniel Whitley

unread,
May 17, 2019, 7:53:00 AM5/17/19
to ansible...@googlegroups.com
Hello-
Without all the info, this looks similar to something I ran into.  Try:

pip3 install docker

This will install the docker Python module for the version of Python that Ansible is using (3.6.7).  

Better yet, have a task in your playbook install it prior to using the docker Ansible module.  Using the pip Ansible module will install the correct version.
-Daniel

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5011c447-dcb4-430b-bc50-7025d51717ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages