I resolved this in case anyone is interested. It's a bug in docker-py (and possibly a conflict with the Amazon AMI) whereby the python six module needs to be upgraded for things to work.
andy On Monday, October 6, 2014 2:27:16 PM UTC+1, [email protected] wrote: > > Hello, > > I'm running into issues with the docker module on ansible 1.7.2 (I also > tried to 1.8). I'm trying to use docker on a VM I have provisioned in EC2. > The relevant part of my playbook looks like this: > > - hosts: daas_daas_management > user: ec2-user > sudo: yes > tasks: > - name: Install docker > yum: name=docker state=latest > > - name: Install docker python > command: easy_install pip > > - command: pip install docker-py > > - name: Start the docker service > service: name=docker state=started > > - name: Login to docker > command: docker login --email="xxxxx" --username="xxxxx" > --password="xxxxx" > > - name: Start the mongo service > docker: image=mongo ports=27017:27017 name=db state=restarted > > Without pip messing about I get errors related to docker.client. With > these present the error I get is this: > > TASK: [Start the mongo service] > *********************************************** > > failed: [54.172.106.43] => {"failed": true, "parsed": false} > > SUDO-SUCCESS-ifunupbpiebrbehdtnzjnxkysxohzizh > > Traceback (most recent call last): > > File > "/home/ec2-user/.ansible/tmp/ansible-tmp-1412601522.36-141448805312079/docker", > > line 342, in <module> > > from docker.client import APIError as DockerAPIError > > File "/usr/lib/python2.6/site-packages/docker/__init__.py", line 20, in > <module> > > from .client import Client # flake8: noqa > > File "/usr/lib/python2.6/site-packages/docker/client.py", line 30, in > <module> > > from . import errors > > ImportError: cannot import name errors > > > So everything works well until I want to try docker commands. I don't > really want to run the commands locally, although I suppose that is an > option if all else fails. > > > Can anyone help? > > > Thanks > > > andy > -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6e74f6fd-8587-433e-a649-942808d72d63%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
