我按照 Ansible 网站上的说明进行操作,但是当我尝试与 Windows 节点通信时,仍然遇到一个简单的“win_ping”命令问题:
Ansible
版本:1.8.2
Windows 机器
操作系统:Windows Server 2012 标准
Powershell:v3.0
我得到的错误:
[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
我需要这方面的帮助,谢谢。
---- 更新 ---
我在 windows 节点上启动了这个 powershell 命令:
> netsh advfirewall firewall add rule Profile=public name="Allow WinRM HTTPS" dir=in localport=5986 protocol=TCP action=allow
然后现在我收到以下错误
[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