【问题标题】:EOF occurred in violation of protocol for ansibleEOF 发生违反 ansible 协议
【发布时间】:2019-06-24 18:47:56
【问题描述】:

我正在新格式化的机器(Windows 10)上安装 ansible。我已启用 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 来获取相同的用户凭据并使用相同的剧本。我的旧机器工作正常,但我的新机器拒绝配合。我不确定我在这里做错了什么。

【问题讨论】:

    标签: openssl ansible


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2016-03-11
      • 2016-01-29
      • 2017-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-09
      • 2013-05-20
      相关资源
      最近更新 更多