Error saying "KeyError: 'ApiVersion'" - Ansible

0 votes

I'm getting the following error:

failed: [] => {"failed": true, "item": "", "parsed": false}
invalid output was: Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-tmp-1400951250.7-173380463612813/docker", line 1959, in <module>
  File "/root/.ansible/tmp/ansible-tmp-1400951250.7-173380463612813/docker", line 693, in main
    containers = manager.create_containers(1)
  File "/root/.ansible/tmp/ansible-tmp-1400951250.7-173380463612813/docker", line 548, in create_containers
    if docker.utils.compare_version('1.10', self.client.version()['ApiVersion']) < 0:
KeyError: 'ApiVersion'

I'm using Ansible version 1,7 and docker version 0.9.1

Jan 8 in Ansible by Ali
• 10,440 points

1 answer to this question.

0 votes

The reason behind this error is that the older version of docker does not have the ApiVersion specified. 

The only thing you can do is update your docker version. Follow these commands:

$ sudo apt-get install -y python-pip
$ sudo pip install docker-py
answered Jan 8 by Sasha

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Remote host throwing error saying "Permission Denied" - Ansible

Hey @Patrick, Change the path of Ansible's remote_tmp ...READ MORE

answered Jan 16 in Ansible by Cerci
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 57,300 points
+1 vote
1 answer