我卡在了 Ansible 的 Windows 模块上。我只是尝试对 Windows 机器进行 ping 测试,但是出现了“连接超时”的错误。
主机
[windows]
192.168.1.13
group_vars/windows.yaml
ansible_user: raja
ansible_password: myPassword
ansible_port: 5986
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore
当我运行以下命令时:ansible windows -vvv -i hosts -m win_ping
Using /etc/ansible/ansible.cfg as config file
<192.168.1.13> ESTABLISH WINRM CONNECTION FOR USER: raja on PORT 5986 TO 192.168.1.13
192.168.1.13 | UNREACHABLE! => {
"changed": false,
"msg": "ssl: HTTPSConnectionPool(host='192.168.1.13', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fcb12024a90>, 'Connection to 192.168.1.13 timed out. (connect timeout=30)'))",
"unreachable": true
}
然而,我可以使用 ping 192.168.1.13
命令对该 Windows 计算机进行 ping 测试。