dockers module issues

Hello,

Would really appreciate pointer here as I have run to a hard wall. I am trying to use ansible to manage and configure docker. So I started on a google search and noticed ansible already has some support for dockers.

However, I don’t seem to get past that. Since I added that task sometime at 12 PM today, I have been having this error;

fatal: [fluorine.eng.example.com]: FAILED! => {“changed”: false, “failed”: true, “msg”: “Failed to import docker-py - No module named requests.exceptions. Try pip install docker-py”}

Docker-py is however already installed. Anybody using this module who have a pointer? Would really be grateful for any help.

william@cacti ~]$ ansible --version
/usr/lib64/python2.6/site-packages/cryptography/init.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
DeprecationWarning
ansible 2.2.2.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
[william@cacti ~]$

[william@cacti ~]$ cat /etc/redhat-release
CentOS release 6.8 (Final)
[william@cacti ~]$

[william@cacti ~]$ sudo pip install docker-py
[sudo] password for william:
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Requirement already satisfied: docker-py in /usr/lib/python2.6/site-packages
Requirement already satisfied: websocket-client>=0.32.0 in /usr/lib/python2.6/site-packages (from docker-py)
Requirement already satisfied: backports.ssl-match-hostname>=3.5; python_version < “3.5” in /usr/lib/python2.6/site-packages (from docker-py)
Requirement already satisfied: ipaddress>=1.0.16; python_version < “3.3” in /usr/lib/python2.6/site-packages (from docker-py)
Requirement already satisfied: six>=1.4.0 in /usr/lib/python2.6/site-packages (from docker-py)
Requirement already satisfied: requests!=2.11.0,>=2.5.2 in /usr/lib/python2.6/site-packages (from docker-py)
Requirement already satisfied: docker-pycreds>=0.2.1 in /usr/lib/python2.6/site-packages (from docker-py)
Requirement already satisfied: argparse in /usr/lib/python2.6/site-packages (from websocket-client>=0.32.0->docker-py)

Regards,
William

Quoting William Muriithi (william.muriithi@gmail.com):

fatal: [fluorine.eng.example.com]: FAILED! => {"changed": false, "failed":
true, "msg": "Failed to import docker-py - No module named
requests.exceptions. Try `pip install docker-py`"}

Docker-py is however already installed.

[ .. ]

[william@cacti ~]$ sudo pip install docker-py
Requirement already satisfied: docker-py

The docker-py package is needed on the host that is actually running the
task: fluorine.eng.example.com. Or you need to 'delegate' the task
depending on the 'docker-py' package to your localhost: cacti.

HTH,
-Sndr.