# docker connection over remote host tcp no tls

**URL:** <https://forum.ansible.com/t/docker-connection-over-remote-host-tcp-no-tls/26078>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [November 20, 2017, 8:09am UTC](https://forum.ansible.com/t/docker-connection-over-remote-host-tcp-no-tls/26078 "2017-11-20T08:09:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esteban\_Mirizio](https://avatars.discourse-cdn.com/v4/letter/e/ecb155/32.png) [@Esteban\_Mirizio](https://forum.ansible.com/u/Esteban_Mirizio)\
**Post date:** [November 20, 2017, 8:09am UTC](https://forum.ansible.com/t/docker-connection-over-remote-host-tcp-no-tls/26078/1 "2017-11-20T08:09:47Z")

</div>

Hi everyone!

I’m Having a hard time trying to a remote docker connection over non tls. What I’m trying to achieve is to execute an ansible playbook inside a docker located in host A to another docker located in host B, FYI network mode is set to **“host”** on both docker hosts.

This is the playbook I’m trying to execute:

`

- hosts: localhost  
tasks:
- name: add container to inventory  
add\_host:  
name: git-slave  
ansible\_connection: docker  
ansible\_docker\_extra\_args: “-H=tcp://192.168.255.2:2375”  
ansible\_user: root  
changed\_when: false
- name: Test gitblit  
delegate\_to: git-slave  
raw: cat /var/log/gitblit  
`

This is the error I’m getting:

fatal: [localhost]: UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: ( umask 77 && mkdir -p "`echo ~/.ansible/tmp/ansible-tmp-1511161385.72-174791577619947`" && echo ansible-tmp-1511161385.72-174791577619947="`echo ~/.ansible/tmp/ansible-tmp-1511161385.72-174791577619947`" ), exited with result 1, stderr output: tls: oversized record received with length 20527\n”,  
“unreachable”: true  
}

Here some test I did:

1. Ping from Host A to Host B

2. Telnet from Host A to Host B against docker remote API:

3. Remote Docker API test from Host A to Host B using curl  
`

4. Execution of ansible playbook using local docker connection from inside HOST B to the target docker

I don’t have idea what could be the problem, I will try to set up TLS and certificates in order to test the example that appears on [http://docs.ansible.com/ansible/latest/intro\_inventory.html#non-ssh-connection-types](http://docs.ansible.com/ansible/latest/intro_inventory.html#non-ssh-connection-types).

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Tom\_van\_Duist](https://avatars.discourse-cdn.com/v4/letter/t/9e8a1a/32.png) [@Tom\_van\_Duist](https://forum.ansible.com/u/Tom_van_Duist)\
**Post date:** [August 21, 2018, 1:21pm UTC](https://forum.ansible.com/t/docker-connection-over-remote-host-tcp-no-tls/26078/2 "2018-08-21T13:21:57Z")

</div>

Hey,

Did you ever solve this issue?

I’m running in to the same problem…

---

<div class="post-metadata">

**Author:** ![dmartin](https://avatars.discourse-cdn.com/v4/letter/d/c4cdca/32.png) [@dmartin](https://forum.ansible.com/u/dmartin)\
**Post date:** [August 21, 2018, 6:31pm UTC](https://forum.ansible.com/t/docker-connection-over-remote-host-tcp-no-tls/26078/3 "2018-08-21T18:31:10Z")

</div>

I think your host B has SSL or TLS running on port 2375 OR ansible is trying to use TLS when the thing running on port 2375 isn’t.

---

<div class="post-metadata">

**Author:** ![Tom\_van\_Duist](https://avatars.discourse-cdn.com/v4/letter/t/9e8a1a/32.png) [@Tom\_van\_Duist](https://forum.ansible.com/u/Tom_van_Duist)\
**Post date:** [August 22, 2018, 2:22pm UTC](https://forum.ansible.com/t/docker-connection-over-remote-host-tcp-no-tls/26078/4 "2018-08-22T14:22:27Z")

</div>

Thank you for the response.

Using ‘openssl s\_client -connect hostB:2375’ from host A to host B I belive that SSL is not active on hostB:2375:

`

CONNECTED(00000003)  
140680139757208:error:140770FC:SSL routines:SSL23\_GET\_SERVER\_HELLO:unknown protocol:s23\_clnt.c:794:
