---
- name: connectionTest
hosts: Windows
tasks:
- name: "Windows Connect"
win_command: hostname
register: wincmd_out在库存中声明的变量Project/inventories/XXX_Local/
[Windows]
XXVMxxxxxxx错误信息:
fatal: [XXVMxxxxxxx]: UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket \"/tmp/awx_1636443_S7HHdB/cp/6b18046463\" does not exist\r\ndebug2: resolving \"XXVMxxxxxxx\" port 22\r\nssh: Could not resolve hostname XXVMxxxxxxx: Name or service not known",
"unreachable": true
}发布于 2019-09-26 09:00:56
看一看您的代码,似乎您试图连接到Windows主机。通常您通过WinRM而不是ssh连接窗口。
这方面的用户指南可以在这里找到:https://docs.ansible.com/ansible/latest/user_指南/窗口_winrm.html
如果无法与Windows主机通信并使用Windows模块,Windows主机必须满足以下要求:
然后,您需要告诉ansible连接wia winrm
...
ansible_connection=winrm
...查看这里的详细信息:https://www.ansible.com/blog/connecting-to-a-windows-host
https://devops.stackexchange.com/questions/9285
复制相似问题