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

**URL:** <https://forum.ansible.com/t/error-while-fetching-server-api-version-connection-aborted-error-111-connection-refused/34129>\
**Category:** Ansible Project\
**Created:** [October 29, 2020, 9:36pm UTC](https://forum.ansible.com/t/error-while-fetching-server-api-version-connection-aborted-error-111-connection-refused/34129 "2020-10-29T21:36:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhagyashri\_Shewale](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@Bhagyashri\_Shewale](https://forum.ansible.com/u/Bhagyashri_Shewale)\
**Post date:** [October 29, 2020, 9:36pm UTC](https://forum.ansible.com/t/error-while-fetching-server-api-version-connection-aborted-error-111-connection-refused/34129/1 "2020-10-29T21:36:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [October 30, 2020, 9:24am UTC](https://forum.ansible.com/t/error-while-fetching-server-api-version-connection-aborted-error-111-connection-refused/34129/2 "2020-10-30T09:24:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Bhagyashri\_Shewale](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@Bhagyashri\_Shewale](https://forum.ansible.com/u/Bhagyashri_Shewale)\
**Post date:** [October 31, 2020, 11:34pm UTC](https://forum.ansible.com/t/error-while-fetching-server-api-version-connection-aborted-error-111-connection-refused/34129/3 "2020-10-31T23:34:02Z")

</div>

Thanks for reaching out.

Here is a simple playbook and role to create a network

playbook:

- hosts: xxxx  
roles:
- network

role (main.yml)

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [November 1, 2020, 3:12pm UTC](https://forum.ansible.com/t/error-while-fetching-server-api-version-connection-aborted-error-111-connection-refused/34129/4 "2020-11-01T15:12:01Z")

</div>

[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_environment.html](https://docs.ansible.com/ansible/latest/user_guide/playbooks_environment.html)
