diff --git a/changelogs/fragments/host.yml b/changelogs/fragments/host.yml new file mode 100644 index 00000000..5f464886 --- /dev/null +++ b/changelogs/fragments/host.yml @@ -0,0 +1,2 @@ +bugfixes: + - "Use ``unix:///var/run/docker.sock`` instead of the legacy ``unix://var/run/docker.sock`` as default for ``docker_host`` (https://github.com/ansible-collections/community.docker/pull/736)." diff --git a/plugins/doc_fragments/docker.py b/plugins/doc_fragments/docker.py index 41c2a873..90a8c70b 100644 --- a/plugins/doc_fragments/docker.py +++ b/plugins/doc_fragments/docker.py @@ -21,7 +21,7 @@ options: - If the value is not specified in the task, the value of environment variable E(DOCKER_HOST) will be used instead. If the environment variable is not set, the default value will be used. type: str - default: unix://var/run/docker.sock + default: unix:///var/run/docker.sock aliases: [ docker_url ] tls_hostname: description: @@ -198,7 +198,7 @@ options: - If the value is not specified in the task, the value of environment variable E(DOCKER_HOST) will be used instead. If the environment variable is not set, the default value will be used. type: str - default: unix://var/run/docker.sock + default: unix:///var/run/docker.sock aliases: [ docker_url ] tls_hostname: description: diff --git a/plugins/inventory/docker_containers.py b/plugins/inventory/docker_containers.py index 955b1b2e..0d319397 100644 --- a/plugins/inventory/docker_containers.py +++ b/plugins/inventory/docker_containers.py @@ -106,7 +106,7 @@ options: EXAMPLES = ''' # Minimal example using local Docker daemon plugin: community.docker.docker_containers -docker_host: unix://var/run/docker.sock +docker_host: unix:///var/run/docker.sock # Minimal example using remote Docker daemon plugin: community.docker.docker_containers diff --git a/plugins/inventory/docker_swarm.py b/plugins/inventory/docker_swarm.py index ab2e1212..8733a8e1 100644 --- a/plugins/inventory/docker_swarm.py +++ b/plugins/inventory/docker_swarm.py @@ -34,7 +34,7 @@ DOCUMENTATION = ''' docker_host: description: - Socket of a Docker swarm manager node (C(tcp), C(unix)). - - "Use V(unix://var/run/docker.sock) to connect via local socket." + - "Use V(unix:///var/run/docker.sock) to connect via local socket." type: str required: true aliases: [ docker_url ] @@ -111,7 +111,7 @@ DOCUMENTATION = ''' EXAMPLES = ''' # Minimal example using local docker plugin: community.docker.docker_swarm -docker_host: unix://var/run/docker.sock +docker_host: unix:///var/run/docker.sock # Minimal example using remote docker plugin: community.docker.docker_swarm diff --git a/plugins/module_utils/util.py b/plugins/module_utils/util.py index 9c6b738c..c6fe5b59 100644 --- a/plugins/module_utils/util.py +++ b/plugins/module_utils/util.py @@ -14,7 +14,7 @@ from ansible.module_utils.common.collections import is_sequence from ansible.module_utils.six.moves.urllib.parse import urlparse -DEFAULT_DOCKER_HOST = 'unix://var/run/docker.sock' +DEFAULT_DOCKER_HOST = 'unix:///var/run/docker.sock' DEFAULT_TLS = False DEFAULT_TLS_VERIFY = False DEFAULT_TLS_HOSTNAME = 'localhost' # deprecated