Error saying KeyError ApiVersion - Ansible

0 votes

I'm getting the following error:

failed: [demo.com] => {"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>
    main()
  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, 2019 in Ansible by Ali
• 11,360 points
671 views

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, 2019 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, 2019 in Ansible by Cerci
4,550 views
0 votes
2 answers
+2 votes
1 answer
+2 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
• 58,090 points
2,471 views
+1 vote
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP