2017-05-25 258 views
1

我已經在Windows Server 2012中機器將使用Ansible團隊提出的腳本配置WinRM的查驗窗機:https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1Ansible:使用基本身份驗證

在Ansible控制機(Linux中),配置是這樣的:

ansible_user: Administrator 
ansible_password: PASS 
ansible_port: 5985 
ansible_connection: winrm 
ansible_winrm_scheme: http 
ansible_winrm_server_cert_validation: ignore 

嘗試ping Windows機器我仍然得到:

10.2.75.142 | UNREACHABLE! => { 
    "changed": false, 
    "msg": "plaintext: the specified credentials were rejected by the server", 
    "unreachable": true 
} 

用戶憑據正在本地Windows我們的憑據呃,屬於管理員組。我仍然想念任何一方的配置?

回答

0

我有類似的問題。通過Ansible我得到:

the specified credentials were rejected by the server 

但是,當執行命令從Windows機器使用winrs時,它很好。例如:

winrs -r:https://myserver.com -u:Administrator -p:PASS ipconfig 

正在經歷。

不幸的是,沒有找到任何解決方案讓Ansible以基本身份驗證運行。 解決方法將使用NTLM身份驗證。剛剛添加

ansible_winrm_transport: ntlm 

控制機器配置,它工作正常以來。