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

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

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

致命:[192.168.6.1]:无法访问! => {“changed”:false,“msg”:“ssl:HTTPSConnectionPool(host ='192.168.6.1',port = 5986):使用url:/ wsman超出最大重试次数(由SSLError引起(SSLEOFError(8,u') EOF发生违反协议(_ssl.c:590)'),))“,”无法访问“:true}任务[收集事实] ******************* ************************************************** ***********************任务路径:/mnt/c/ansible/test.yml:1使用模块文件/home/xxxxxx/.local /lib/python2.7/site-packages/ansible/modules/windows/setup.ps1 <192.168.6.1>为用户 Build WINRM连接:在PORT 5986上的xxxx到192.168.6.1检查winrm_host 192.168.6.1是否为IPv6地址< 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):超出最大重试次数使用url:/ wsman(由SSLError引起(SSLEOFError(8,u'EOF违反协议(_ssl.c:590)发生),))Traceback(最近一次调用最后一次):文件“/ home / chanondw / . LOC al / lib / python2.7 / site-packages / ansible / plugins / connection / winrm.py“,第345行,在_winrm_connect self.shell_id = protocol.open_shell(codepage = 65001)#UTF-8文件”/ home / chanondw /.local/lib/python2.7/site-packages/winrm/protocol.py“,第157行,在open_shell中res = self.send_message(xmltodict.unparse(req))文件”/home/chanondw/.local/lib /python2.7/site-packages/winrm/protocol.py“,第234行,在send_message中resp = self.transport.send_message(message)文件”/home/chanondw/.local/lib/python2.7/site-packages /winrm/transport.py“,第256行,在send_message响应= self._send_message_request(prepared_request,message)文件”/home/chanondw/.local/lib/python2.7/site-packages/winrm/transport.py“,第261行,在_send_message_request响应= self.session.send(prepared_request,timeout = self.read_timeout_sec)文件“/home/chanondw/.local/lib/python2.7/site-packages/requests/sessions.py”,第618行,在send r = adapter.send(request, kwargs)File“/home/chanondw/.local/lib/python2.7/site-packages/re “quests / adapters.py”,第506行,发送引发SSLError(e,请求=请求)SSLError:HTTPSConnectionPool(host ='192.168.6.1',port = 5986):使用url:/ wsman超出最大重试次数(由SSLError引起) (SSLEOFError(8,u'EOF发生违反协议(_ssl.c:590)'),))

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