2017-06-14 213 views
-1

我们有一个Linux管理软件安装在Windows域中的服务器。我们成功地将软件安装到我们所有的Windows机器上,没有问题。我们只是增加了一个新的Windows 10的计算机(是的,我们已经成功地连接到其他Win10的电脑),而当我们运行ansible安装脚本,我们得到以下错误Ansible试图通过SSH连接到Windows计算机(失败)

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 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket \"/home/ansible/.ansible/cp/ansible-ssh-afc54-22-ansible\" does not exist\r\ndebug2: ssh_connect: needpriv 0\r\ndebug1: Connecting to afc54 [192.168.2.193] port 22.\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: connect to address 192.168.2.193 port 22: Connection timed out\r\nssh: connect to host afc54 port 22: Connection timed out\r\n", "unreachable": true

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

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

,而其他的Windows机器显示

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

为什么ansbile试图通过SSH而不是Windows端口5986连接?相同的脚本可以在我们所有其他的Windows电脑上成功运行,但是这一个脚本让我难倒了。

编辑: 如果我指定的主机文件对机器的线的凭据和规格(即[email protected] 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 }

+0

您不提供足够的信息来回答问题。控制机器上的配置不同(最有可能使用不同的库存),这就是为什么你得到不同的结果。 – techraf

+0

更多信息会有帮助吗?我们已经成功运行了与Windows计算机完全相同的品牌和型号的Dell Optiplex 3040,Win10,Powershell V5。我从来没有见过Ansible尝试使用SSH连接到Windows计算机,任何想法可能导致这种情况? – phandolin

+0

我不清楚为什么这会起作用,但我更改了hosts文件和playbook中的组名(它是[install]现在是[windows]),现在它正确运行。 – phandolin

回答

-1

我不明白为什么这个工作,但我更改了主机文件和操作手册中的组名(这是[install]现在是[windows]),现在它正确运行。