我按照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
答案 0 :(得分:1)
该问题与windows.yml文件中的用户有关。 用户在域上,Ansible尚未实现 所以我们必须使用在机器上设置域名的Windows用户。
如果您需要域帐户。 请参阅:http://docs.ansible.com/intro_windows.html#installing-on-the-control-machine