From f892ca5b8faef0712b114fa340298be26d91f717 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Mon, 16 Mar 2015 11:43:52 -0700 Subject: [PATCH] Also use DOCKER_TLS_VERIFY env var to turn on tls verification --- lib/ansible/modules/cloud/docker/docker.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/modules/cloud/docker/docker.py b/lib/ansible/modules/cloud/docker/docker.py index d22d0027a23..56eb2516886 100644 --- a/lib/ansible/modules/cloud/docker/docker.py +++ b/lib/ansible/modules/cloud/docker/docker.py @@ -546,6 +546,7 @@ class DockerManager(object): # Connect to the docker server using any configured host and TLS settings. env_host = os.getenv('DOCKER_HOST') + env_docker_verify = os.getenv('DOCKER_TLS_VERIFY') env_cert_path = os.getenv('DOCKER_CERT_PATH') env_docker_hostname = os.getenv('DOCKER_TLS_HOSTNAME') @@ -593,6 +594,9 @@ class DockerManager(object): # or tls_ca_cert (which requests verifying the server with # a specific ca certificate) use_tls = module.params.get('use_tls') + if use_tls is None and env_docker_verify is not None: + use_tls = 'verify' + tls_config = None if use_tls != 'no': params = {}