Recently got the Ansible docker module working after I learned that it requires the ‘docker-py’ module installed on the server. It took me a while to figure this out.
I was going to put a PR together that clarify this for others, but 1) not sure where to put it and 2) couldn’t this be automated? The docker module has this in the documentation:
requirements: [ “docker-py >= 0.3.0”, “docker >= 0.10.0” ]
So to address this, all I had to do was add the pip task to my playbook:
- name: Install Docker-py
pip: name=docker-py - name: run nginx
docker: image=nginx name=nginx ports=443:80
If the requirements metadata was exposed, couldn’t we have something like this
- name: run nginx
docker: image=nginx name=nginx ports=443:80
install_deps: true
That would automatically just install any pip requirements of the module? Forgive me if something like this already exists.