Ansible 2.8.7 API 使用异常5:/wsman (Caused by SSLError(SSLError("bad handshake: SysCallError(104, 'ECONN

#1. 异常信息

requests.exceptions.SSLError: HTTPSConnectionPool(host='192.168.1.168', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLError("bad handshake: SysCallError(104, 'ECONNRESET')")))

#2. 原因及解决

  • 创建WinRM_HTTPS时,限制了IP监听,但使用的是Ansible服务器的IP,理解有误
  • 应使用客户机自己的IP

#3. 代码

PS C:\Windows\system32> winrm E winrm/config/Listener
    Listener
        Address = *
        Transport = HTTP
        Port = 5985
        Hostname
        Enabled = true
        URLPrefix = wsman
        CertificateThumbprint
        ListeningOn = 192.168.1.168, 127.0.0.1, 169.254.48.226
    
    Listener
        Address = IP:192.168.1.168
        Transport = HTTPS
        Port = 5986
        Hostname = XXXXXXXXXXXXX.CENTOS.TEST.com
        Enabled = true
        URLPrefix = wsman
        CertificateThumbprint = 236XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXA
        ListeningOn = 192.168.1.168

你可能感兴趣的:(Ansible2.8.7)