Error while trying to ping a WIN 2016

Hi Team,

I’m running Ansible 2.4.3.0 on a Ubuntu server. While trying to access a Windows 2016 server, getting below error. The DNS is working fine. Can someone help me in fixing this?

ansible_host=XXX.XXX.XX | UNREACHABLE! => {
“changed”: false,
“msg”: “ssl: HTTPSConnectionPool(host=‘ansible_host= XXX.XXX.XX ‘, port=5986): Max retries exceeded with url: /wsman (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x7f0f3e5d5c50>: Failed to establish a new connection: [Errno -2] Name or service not known’,))”,
“unreachable”: true

It really does sound like DNS is the issue, the problem is due to an underlying library not being able to establish the connection. You can try and just setup a raw connection with openssl to verify the host is resolvable and the HTTPS stack is working on the Windows side. To do this run,

openssl s_client -host hostname -port 5986

Thanks

Jordan

I’d add ‘use hostnames, not ip addresses’ as well, HTTPS (and kerberos/Active Directory) really need hostnames, not ip addresses to work (you may be, I can’t tell from your example though).
Hope this helps,
Jon