Ava*_*lon 2 kerberos winrm ansible windows-server-2012-r2
我正在 Ansible 中构建一个 playbook,它将向多个 Windows 2012 R2 域控制器 (DC) 添加一些 DNS 条目。当尝试通过 HTTP 进行身份验证时,DC 拒绝我的凭据。
我已按照 Ansible 网站上的文档在我的控制计算机上配置 kerberos。
http://docs.ansible.com/ansible/intro_windows.html#active-directory-support
我还确认我可以使用我的凭据登录域:
$ klist
Ticket cache: FILE:/tmp/krb5cc_1000
Default principal: my-user@<REDACTED>
Valid starting Expires Service principal
10/06/2016 09:47:03 10/06/2016 19:47:03 krbtgt/<REDACTED>@<REDACTED>
renew until 10/07/2016 09:46:59
10/06/2016 09:47:48 10/06/2016 19:47:03 HTTP/phx-dev-mwad01.<REDACTED>@<REDACTED>
renew until 10/07/2016 09:46:59
10/06/2016 09:54:15 10/06/2016 19:47:03 HTTP/phx-dev-mwad02.<REDACTED>@<REDACTED>
renew until 10/07/2016 09:46:59
10/06/2016 12:08:28 10/06/2016 19:47:03 HTTP/phx-dev-want01.<REDACTED>@<REDACTED>
renew until 10/07/2016 09:46:59
Run Code Online (Sandbox Code Playgroud)
出于安全目的,我编辑了该域名。
这是我的 winrm 配置文件:
ansible_user: my-user@<REDACTED>
ansible_password: SomePass
ansible_port: 5985
ansible_connection: winrm
# The following is necessary for Python 2.7.9+ when using default WinRM self-signed certificates:
ansible_winrm_server_cert_validation: ignore
Run Code Online (Sandbox Code Playgroud)
我能够通过端口 5986 (HTTPS) 连接到 Windows 服务器,但是在生产中,域控制器未配置为 5986,因此 Ansible必须能够通过端口 5985 (HTTP) 建立连接。这一要求在生产中不会改变。
当尝试通过 5985 连接时,我的凭据被拒绝;
fatal: [phx-dev-mwad02]: UNREACHABLE! => {"changed": false, "msg": "kerberos: (u'http', u'Bad HTTP response returned from server. Code 500'), plaintext: the specified credentials were rejected by the server", "unreachable": true}
Run Code Online (Sandbox Code Playgroud)
WinRM 设置为允许远程管理:
$winrm quickconfig
WinRM service is already running on this machine.
WinRM is already set up for remote management on this computer.
Run Code Online (Sandbox Code Playgroud)
以下是我们的 WinRM 配置要点:
https://gist.github.com/anonymous/f2baaff517287c535453dbba4ef03b69
是的,我已经确认我的凭据是正确的。
查看AllowUnencrypted = false你的 winrm 服务器的配置。目前看来 python winrm 不支持没有 https 的消息加密。作为解决方法,您可以将其设置为 true ,这是不安全的,所以我强烈不建议这样做(cmd):
winrm set winrm/config/service @{AllowUnencrypted="true"}
Run Code Online (Sandbox Code Playgroud)
请参阅https://pypi.python.org/pypi/pywinrmHTTP or HTTPS endpoint部分
| 归档时间: |
|
| 查看次数: |
4794 次 |
| 最近记录: |