Ansible 尝试通过 SSH 连接到 Windows 计算机(失败)



我们有一个Linux服务器管理Windows域上的软件安装。我们已经成功地将软件安装到我们所有的Windows机器上,没有问题。我们刚刚添加了一台新的 Windows 10 计算机(是的,我们已经成功连接到其他 Win10 计算机(,当我们运行我们的 ansible 安装脚本时,我们收到以下错误

fatal: [afc54]: UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 56: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug1: Control socket "/home/ansible/.ansible/cp/ansible-ssh-afc54-22-ansible" does not existrndebug2: ssh_connect: needpriv 0rndebug1: Connecting to afc54 [192.168.2.193] port 22.rndebug2: fd 3 setting O_NONBLOCKrndebug1: connect to address 192.168.2.193 port 22: Connection timed outrnssh: connect to host afc54 port 22: Connection timed outrn", "unreachable": true

在剧本的[收集事实]部分中,新机器显示

Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setu‌​p.py

而其他窗口计算机显示

Using module file /usr/lib/python2.7/site-packages/ansible/modules/windows/win‌​_updates.ps1

为什么 ansbile 尝试通过 SSH 而不是 Windows 端口 5986 进行连接?相同的脚本在我们所有的其他Windows计算机上都成功运行,但是这个脚本让我感到困惑。

编辑:如果我在主机文件中的机器行上指定凭据和规格(即 ansible_user=user@domain ansible_password=password ansible_port=5986 ansible_connection=winrm ( 然后我收到以下错误

afc54 | UNREACHABLE! => { "changed": false, "msg": "kerberos: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579), ssl: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)", "unreachable": true }

我不清楚为什么这样做,但我在主机文件和剧本中更改了组名(它[install]现在是[windows](,它现在运行正常。

编辑:一年后,我终于注意到了这起作用的原因。在 group_vars 目录中,没有为[install]设置任何内容,但在 windows.yml 下有一个用于[windows]的现有配置 希望这对其他人有所帮助=(

相关内容

最新更新