mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-01-28 23:16:22 +00:00
(cherry picked from commit 5ba7b555a0)
This commit is contained in:
parent
d3be36c911
commit
f54cb0ceed
2
changelogs/fragments/1226-docker-sdk-tls.yml
Normal file
2
changelogs/fragments/1226-docker-sdk-tls.yml
Normal file
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- "modules and plugins using the Docker SDK for Python - do not automatically set ``tls_hostname`` when ``validate_certs=true`` for Docker SDK for Python 7.0.0+ (https://github.com/ansible-collections/community.docker/issues/1225, https://github.com/ansible-collections/community.docker/pull/1226)."
|
||||
@ -160,9 +160,10 @@ def get_connect_params(auth, fail_function):
|
||||
# TLS with verification
|
||||
tls_config = dict(
|
||||
verify=True,
|
||||
assert_hostname=auth['tls_hostname'],
|
||||
fail_function=fail_function,
|
||||
)
|
||||
if auth["tls_hostname"] is not None:
|
||||
tls_config["assert_hostname"] = auth["tls_hostname"]
|
||||
if auth['cert_path'] and auth['key_path']:
|
||||
tls_config['client_cert'] = (auth['cert_path'], auth['key_path'])
|
||||
if auth['cacert_path']:
|
||||
@ -327,7 +328,8 @@ class AnsibleDockerClientBase(Client):
|
||||
use_ssh_client=self._get_value('use_ssh_client', params['use_ssh_client'], None, False, type='bool'),
|
||||
)
|
||||
|
||||
update_tls_hostname(result)
|
||||
if LooseVersion(docker_version) < LooseVersion("7.0.0b1"):
|
||||
update_tls_hostname(result)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user