docker module requirements met, but ansible misses docker-py

1,063 views
Skip to first unread message

Goetz Leupold

unread,
Apr 15, 2016, 8:41:14 AM4/15/16
to Ansible Project
Hello everybody,

got 2 Servers with docker and ansible requirements to manipulate them. But at server B , ansible doent find docker-py allthough it is installed. The versions of the installed softwares differ, so i guess there is the problem.

Server A(working):
python2.7
docker_py-1.7.2.egg-info
Server:
 Version:      1.10.3
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   20f81dd
 Built:        Thu Mar 10 15:48:06 2016
 OS/Arch:      linux/amd64

Server B(not working):
python2.7
docker_py-1.8.0.egg-info
Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   a34a1d5
 Built:        Fri Nov 20 17:56:04 UTC 2015
 OS/Arch:      linux/amd64

If i try then to start a container through ansible i got the error:
fatal: [HOST]: FAILED! => {"changed": false, "failed": true, "msg": "`docker-py` doesn't seem to be installed, but is required for the Ansible Docker module."}

Any ideas? If you need more specific information let me know and excuse my bad english :D

Greetings,
Götz

Hadrien B.

unread,
May 25, 2016, 10:22:03 AM5/25/16
to Ansible Project
Hi, 

I have the same issue. 
Any solution ?

Brian Coca

unread,
May 25, 2016, 5:14:08 PM5/25/16
to ansible...@googlegroups.com
You are probably not executing the same version of python that has docker-py installed.

​​

----------
Brian Coca

Henry Gallo

unread,
Jul 22, 2016, 8:35:40 AM7/22/16
to Ansible Project
Hey did you figure it out. I have the same problem: specs below:

pip -V
pip 8.1.2 from /usr/lib/python2.6/site-packages (python 2.6)

pip freeze |grep docker
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
docker-compose==1.7.1
docker-py==1.8.1
dockerpty==0.4.1

error message below: 
: FAILED! => {"changed": false, "failed": true, "msg": "`docker-py` doesn't seem to be installed, but is required for the Ansible Docker module."}

Gallo

unread,
Jul 23, 2016, 9:27:51 AM7/23/16
to Ansible Project
Found a work around, by adding specifics of pip and docker-py to the playbook

---
- name: install pip
  yum: name=python-pip state=latest

- name: work around docker-py
  pip:
    executable=/usr/local/bin/pip
    name=docker-py
    state=present
    version=1.8.1
Reply all
Reply to author
Forward
0 new messages