Winrm connection error - 500 WinRMTransport. [Errno -2] Name or service not known

I tried to ping windows server from ansible, and getting the below error:

$ ansible windows -m win_ping -vvvv
<windowsserver.cloudapp.net> ESTABLISH WINRM CONNECTION FOR USER: windowsuser on PORT 5986 TO windowsserver.cloudapp.net
<windowsserver.cloudapp.net> WINRM CONNECT: transport=plaintext endpoint=https://windowsserver.cloudapp.net:5986/wsman
<windowsserver.cloudapp.net> WINRM CONNECTION ERROR: 500 WinRMTransport. [Errno -2] Name or service not known
<windowsserver.cloudapp.net> WINRM CONNECT: transport=plaintext endpoint=http://windowsserver.cloudapp.net:5986/wsman
<windowsserver.cloudapp.net> WINRM CONNECTION ERROR: 500 WinRMTransport. [Errno -2] Name or service not known
windowsserver.cloudapp.net | FAILED => 500 WinRMTransport. [Errno -2] Name or service not known

I have correct host under inventories/hosts file, and windows user/pass under group_vars/windows.yml

It worked fine earlier some time back, but has name or service not known error. where might be the issue?

Can your ansible controller machine resolve the name windowsserver.cloudapp.net to an ip address?
If so, check that firewalling alllows connections to port 5986.

Hi,

Seems this is intermediate issues with azure i think.

Now it works from ansible, earlier it did not worked (from ansible, but worked when directly connected via rdc) for myself and other collegues too… Strange!