无法使用Ansible ping windows计算机

无法使用Ansible ping windows计算机,ansible,Ansible,我是Ansible新手,正在尝试使用Ansible连接到windows计算机。 我得到以下错误 xxx.xxx.xxx.com | UNREACHABLE! => { "changed": false, "msg": "plaintext: HTTPConnectionPool(host='xxx.xxx.xxx.com', port=5985): Max retries exceeded with url: /wsman (Caused by NewConnectionError('&l

我是Ansible新手,正在尝试使用Ansible连接到windows计算机。 我得到以下错误

xxx.xxx.xxx.com | UNREACHABLE! => {
"changed": false,
"msg": "plaintext: HTTPConnectionPool(host='xxx.xxx.xxx.com', port=5985): Max retries exceeded with url: /wsman (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x3d76050>: Failed to establish a new connection: [Errno 111] Connection refused',))",
"unreachable": true
xxx.xxx.xxx.com |无法访问!=>{
“更改”:错误,
“msg”:“明文:HTTPConnectionPool(host='xxx.xxx.xxx.com',port=5985):url:/wsman超过了最大重试次数(由NewConnectionError引起(':未能建立新连接:[Errno 111]连接被拒绝',)”,
“遥不可及”:真实
}

我对这三个文件进行了更改

  • 库存:

    [视窗] xxx.xxx.xxx.com

  • Krb5.conf

    [领域] 三十、 XXX.COM={ kdc=xxx.xxx.xxx.com admin_server=xxx.xxx.xxx.com } [domain\u realm] .xxx.xxx.com=xxx.xxx.com

  • 组变量/windows.yml

    ansible_ssh_用户:用户 ansible_ssh_pass:密码 ansible_ssh_端口:5985 ansible_连接:winrm

  • 我是新手,可能在连接过程中犯了错误。 任何帮助都将不胜感激。提前感谢。

    消息键显示“明文”,您需要使用ansible提供的PowerShell脚本在windows主机上启用winrm over ssl:


    由于这将添加自签名证书,请确保将
    ansible\u winrm\u server\u cert\u validation:ignore
    添加到您的组\u vars/windows.yml

    只是为了确定,您已经在清单中的windows计算机上设置了winrm功能,对吗?不,我没有,但我会这么做的。我也尝试了{ansible windows-I hosts-m ping},这也返回了相同的错误,-m ping实际上使用ssh,它不是传统的ICMP ping。由于Windows使用“winrm”而不是“ssh”,因此“-m ping”在Windows系统上失败。