Skip to content
Snippets Groups Projects
Commit 87ce5cd6 authored by Pavel Glushchak's avatar Pavel Glushchak
Browse files

kolla_toolbox: allow docker api version to be specified


When docker-py is newer than docker daemon following
APIError may be raised:

client is newer than server (client API version: 1.24, server API version: 1.22)

So it's better to pass api_version='auto' to docker client,
so client will discover suitable version if not specified.

Change-Id: Ib747ed91b315ca762936a6efa6b71a29b2d2ae1e
Signed-off-by: default avatarPavel Glushchak <pglushchak@virtuozzo.com>
parent 8b58515e
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,12 @@ options:
- The extra variables used by the module
required: False
type: str or dict
api_version:
description:
- The version of the API for docker-py to use when contacting Docker
required: False
type: str
default: auto
author: Jeffrey Zhang
'''
......@@ -113,10 +119,12 @@ def main():
specs = dict(
module_name=dict(type='str'),
module_args=dict(type='str'),
module_extra_vars=dict(type='json')
)
module_extra_vars=dict(type='json'),
api_version=dict(required=False, type='str', default='auto')
)
module = AnsibleModule(argument_spec=specs, bypass_checks=True)
client = get_docker_client()()
client = get_docker_client()(
version=module.params.get('api_version'))
command_line = gen_commandline(module.params)
kolla_toolbox = client.containers(filters=dict(name='kolla_toolbox',
status='running'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment