在远程windows服务器上
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主机上:
# 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
}发布于 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模块的代码在不可接受的模块。核心存储库中。
https://serverfault.com/questions/804000
复制相似问题