Error while fetching server API version: ('Connection aborted.', error(111, 'Connection refused'))

I don’t want to pass docker tls variables to individual ansible roles instead I want to pass as environment variables.

Where I can exactly define these variable. I tried to set host environment variable but still default variables are passed

DOCKER_CERT_PATH
DOCKER_HOST
DOCKER_TLS
DOCKER_TLS_HOSTNAME
DOCKER_TLS_VERIFY

ansible version

ansible 2.8.6
config file = None
configured module search path = [u’/home/ansible/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.15 (default, Jan 14 2020, 10:33:49) [GCC 6.4.0]

Docker version 19.03.12

Any help is very much appreciated!

Thanks

to avoid guessing what your playbook looks like, can you post it perhaps?

Thanks for reaching out.

Here is a simple playbook and role to create a network

playbook:

  • hosts: xxxx
    roles:
  • network

role (main.yml)

https://docs.ansible.com/ansible/latest/user_guide/playbooks_environment.html