I follow the instructions on Ansible website, but I'm still facing an issue with a simple "win_ping" command when i try to communicate with a windows node:
Ansible
Version : 1.8.2
Windows machine
OS : Windows Server 2012 Standard
Powershell : v3.0
the error I got:
[root@fgr-lgchefap101 group_vars]# ansible windows -m win_ping -vvvv
<fgr-wgcitmp201> ESTABLISH WINRM CONNECTION FOR USER: devci on PORT 5986 TO fgr-wgcitmp201
<fgr-wgcitmp201> WINRM CONNECT: transport=plaintext endpoint=https://fgr-wgcitmp201:5986/wsman
<fgr-wgcitmp201> WINRM CONNECTION ERROR: 500 WinRMTransport. [Errno 8] _ssl.c:492: EOF occurred in violation of protocol
<fgr-wgcitmp201> WINRM CONNECT: transport=plaintext endpoint=http://fgr-wgcitmp201:5986/wsman
<fgr-wgcitmp201> WINRM CONNECTION ERROR: 500 WinRMTransport. Bad HTTP response returned from server. Code 503, Service Unavailable
fgr-wgcitmp201 | FAILED => 500 WinRMTransport. Bad HTTP response returned from server. Code 503, Service Unavailable
I need help on this, thanks.
---- UPDATE ---
I launched this powershell command on the windows node:
> netsh advfirewall firewall add rule Profile=public name="Allow WinRM HTTPS" dir=in localport=5986 protocol=TCP action=allow
and then now I get the following error
[root@fgr-lgchefap101 fadhely]# ansible windows -m win_ping -vvvv
<fgr-wgcitmp201> ESTABLISH WINRM CONNECTION FOR USER: devci on PORT 5986 TO fgr-wgcitmp201
<fgr-wgcitmp201> WINRM CONNECT: transport=plaintext endpoint=https://fgr-wgcitmp201:5986/wsman
<fgr-wgcitmp201> WINRM CONNECTION ERROR: 401 Unauthorized. basic auth failed
<fgr-wgcitmp201> WINRM CONNECT: transport=plaintext endpoint=http://fgr-wgcitmp201:5986/wsman
<fgr-wgcitmp201> WINRM CONNECTION ERROR: 500 WinRMTransport. [Errno 104] Connection reset by peer
fgr-wgcitmp201 | FAILED => 500 WinRMTransport. [Errno 104] Connection reset by peer