EOF违反了ansible协议

时间:2018-04-03 08:42:04

标签: openssl ansible

我正在新格式化的机器上安装ansible(Windows 10)。我启用了WSL,并使用以下命令集安装了ansible。

sudo apt-get-y install python-pip python-dev libffi-dev libssl-dev pip install ansible --user echo `PATH=$HOME/.local/bin:$PATH` >> ~/.bashrc pip install "pywinrm>=0.2.2"

我写了一个简单的win_ping模块,它返回了这个错误,并带有以下详细信息。

  

致命:[192.168.6.1]:无法访问! => {      “改变了”:错误,      “msg”:“ssl:HTTPSConnectionPool(host ='192.168.6.1',port = 5986):使用url:/ wsman超出了最大重试次数(由SSLError引起(SSLEOFError(8,u'EOF违反协议发生)(_ssl。 C:590)'),))”,      “无法到达”:是的   }

     

TASK [Gathering Facts] ********************************************************************************************** task path: /mnt/c/ansible/test.yml:1 Using module file /home/xxxxxx/.local/lib/python2.7/site-packages/ansible/modules/windows/setup.ps1 <192.168.6.1> ESTABLISH WINRM CONNECTION FOR USER: xxxx on PORT 5986 TO 192.168.6.1 checking if winrm_host 192.168.6.1 is an IPv6 address <192.168.6.1> WINRM CONNECT: transport=ssl endpoint=https://192.168.6.1:5986/wsman <192.168.6.1> WINRM CONNECTION ERROR: HTTPSConnectionPool(host='192.168.6.1', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:590)'),)) Traceback (most recent call last): File "/home/chanondw/.local/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py", line 345, in _winrm_connect self.shell_id = protocol.open_shell(codepage=65001) # UTF-8 File "/home/chanondw/.local/lib/python2.7/site-packages/winrm/protocol.py", line 157, in open_shell res = self.send_message(xmltodict.unparse(req)) File "/home/chanondw/.local/lib/python2.7/site-packages/winrm/protocol.py", line 234, in send_message resp = self.transport.send_message(message) File "/home/chanondw/.local/lib/python2.7/site-packages/winrm/transport.py", line 256, in send_message response = self._send_message_request(prepared_request, message) File "/home/chanondw/.local/lib/python2.7/site-packages/winrm/transport.py", line 261, in _send_message_request response = self.session.send(prepared_request, timeout=self.read_timeout_sec) File "/home/chanondw/.local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/home/chanondw/.local/lib/python2.7/site-packages/requests/adapters.py", line 506, in send raise SSLError(e, request=request) SSLError: HTTPSConnectionPool(host='192.168.6.1', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:590)'),))

我也使用ansible获取相同的用户凭据并使用相同的playbook。我的旧机器工作正常,但我的新机器拒绝合作。我不确定我在这里做错了什么。

1 个答案:

答案 0 :(得分:0)

也许主机上没有证书? 尝试使用-ForceNewSSLCert选项运行主机准备脚本。 ConfigureRemotingForAnsible.ps1 -ForceNewSSLCert