首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ansible win_ping收到一个错误

问ansible win_ping收到一个错误
EN

Server Fault用户
提问于 2016-09-19 14:24:18
回答 1查看 5.7K关注 0票数 -1

在远程windows服务器上

代码语言:javascript
复制
 PS C:\Users\name.domain> Winrm quickconfig
 WinRM service is already running on this machine.
 WinRM is already set up for remote management on this computer.

在我安装了Ansible的linux主机上:

代码语言:javascript
复制
 # klist
 Ticket cache: FILE:/tmp/krb5cc_0
 Default principal: user_name@domain.local

Valid starting       Expires              Service principal
09/19/2016 10:02:18  09/19/2016 20:02:18  krbtgt/DOMAIN.LOCAL@DOMAIN.LOCAL
    renew until 09/26/2016 10:02:12


/etc/ansible/hosts

 [local]
 127.0.0.1

 [windows]
 ip address 

[windows:vars]
ansible_user= name@Domain.com
ansible_password= password
ansible_port= 5985
ansible_connection= winrm



# ansible windows -m win_ping
 ip_address | UNREACHABLE! => {
 "changed": false,
"msg": "kerberos: requested auth method is kerberos, but requests_kerberos    is not installed, ssl: HTTPSConnectionPool(host='ip_address', port=5986): Max   retries exceeded with url: /wsman (Caused by   ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x3585d90>, 'Connection to ip_address timed out. (connect timeout=30)'))",
"unreachable": true
}
EN

回答 1

Server Fault用户

发布于 2016-09-20 10:32:14

错误信息非常清楚:

"msg":"kerberos:所请求的auth方法是kerberos,但没有安装requests_kerberos。

为了使用带有Kerberos身份验证的Ansible Windows支持,必须在控件主机上安装一些依赖项:

如果希望连接到通过发布的域帐户(与在远程主机上创建的本地帐户不同),则需要在Ansible控件主机(以及它所依赖的麻省理工学院krb5库)上安装“”模块。Ansible控件主机还需要在Active中配置正确的计算机帐户。

有关活动目录支持的进一步说明,请参阅Ansible文档。

ping模块的情况可能有点混乱。使用这些模块可以确保Ansible能够在目标主机上执行命令。有人可能会认为Ansible会在控制框上对目标主机运行ping命令。但事实并非如此。

因此,实际的win_ping模块是用PowerShell编写的,将在目标主机上执行,因此需要适当的Kerberos设置。win_ping模块的代码在不可接受的模块。核心存储库中。

另见不可用文档: Windows模块是如何工作的。

票数 2
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/804000

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档