0

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
yos
  • 11
  • 1
  • 7
  • I worked with Ansible targeting Windows servers as you, and I found this module too immature (it was 2 months ago, maybe this has changed since then). My workaround (and still working like a charm) was installing cygwin and enabling ssh. Then I just used them as any other Linux server. – mauriciojost May 29 '15 at 07:02

1 Answers1

1

The issue is related to the user in the windows.yml file. The user is on the Domain, it's not yet implemented by Ansible so we have to use a windows user with a domain set on the machine.

If you need domain account. See : http://docs.ansible.com/intro_windows.html#installing-on-the-control-machine

yos
  • 11
  • 1
  • 7