2015-02-24 90 views
0

我遵循Ansible網站, 指示,但我仍然面臨着一個問題,一個簡單的「win_ping」命令時,我嘗試使用Windows節點進行通信:ANSIBLE的Windows WinRM的401

Ansible
版本:1.8.2

Windows機器
操作系統:Windows Server 2012標準
PowerShell的:3.0

錯誤我:

[[email protected] 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 

我需要這種幫助,謝謝。

----更新---
我在Windows節點上推出了這款PowerShell命令:

> netsh advfirewall firewall add rule Profile=public name="Allow WinRM HTTPS" dir=in localport=5986 protocol=TCP action=allow 

,然後現在我得到以下錯誤

[[email protected] 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 
+0

我和Ansible一起針對Windows服務器與您一起工作,並且發現此模塊太不成熟(這是2個月前,也許此後發生了變化)。 我的解決方法(仍然像魅力一樣)安裝了cygwin並啓用了ssh。然後,我只是將它們用作其他任何Linux服務器。 – mauriciojost 2015-05-29 07:02:56

回答