Docker issues

144 views
Skip to first unread message

tech...@andypiper.com

unread,
Oct 6, 2014, 9:27:16 AM10/6/14
to ansible...@googlegroups.com
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

tech...@andypiper.com

unread,
Oct 8, 2014, 4:41:14 AM10/8/14
to ansible...@googlegroups.com
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

Neo Nix

unread,
Sep 25, 2015, 7:59:41 AM9/25/15
to Ansible Project
Hi Andy,

Can you give me a bit more details on how this was done?
Reply all
Reply to author
Forward
0 new messages