首页 文章

Ansible:使用基本身份验证ping Windows机器

提问于
浏览
1

我使用Ansible团队建议的脚本在Windows Server 2012计算机上配置了WinRM:https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1

在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
}

用户凭据是属于Administrator组的本地Windows用户的工作凭据 . 我还在错过任何一方的配置吗?

1 回答

  • 1

    我有类似的问题 . 通过Ansible,我得到了:

    the specified credentials were rejected by the server
    

    但是当使用winrs从windows机器执行命令时,它很好 . 例如:

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

    正在经历 .

    不幸的是没有找到任何解决方案让Ansible运行基本身份验证 . Workaround 曾使用 NTLM authentication . 刚刚添加

    ansible_winrm_transport: ntlm
    

    控制机器配置,从那以后工作正常 .

相关问题