【问题标题】:Ansible-Tower ssl: the specified credentials were rejected by the serverAnsible-Tower ssl:指定的凭据被服务器拒绝
【发布时间】:2018-04-05 15:47:14
【问题描述】:

使用 ansible-tower 连接到我的 Windows 机器时出现以下错误。

我确实使用了ansible tower connecting to windows,他们建议在inventories > variables下使用以下内容:

ansible_connection: winrm
ansible_ssh_port: 5986
ansible_winrm_server_cert_validation: ignore

但是当我运行作业时它仍然失败,看起来它仍在尝试使用ssh 而不是winrm 进行连接。以下是我的 ansible tower 工作的输出:

> ansible-playbook 2.4.1.0   
 config file = /etc/ansible/ansible.cfg  
> configured module search path = [u'/var/lib/awx/.ansible/plugins/modules',
> u'/usr/share/ansible/plugins/modules']   ansible python module
> location = /usr/lib/python2.7/site-packages/ansible   executable
> location = /usr/bin/ansible-playbook   python version = 2.7.5
> (default, May  3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat
> 4.8.5-14)] Using /etc/ansible/ansible.cfg as config file SSH password:  PLAYBOOK: main.yaml
> ************************************************************ 1 plays in main.yaml PLAY [all]
> ********************************************************************* 11:24:35 TASK [Gathering Facts]
> ********************************************************* 11:24:35 fatal: [server_ip]: UNREACHABLE! => {"changed": false, "msg": "ssl:
> the specified credentials were rejected by the server", "unreachable":
> true}

我错过了什么吗?我看到大多数人都在谈论 ansible 而不是 Tower。我能够使用 ansible 来完成这项工作,所以我知道我可以连接到 Windows 服务器。谢谢。

【问题讨论】:

    标签: ansible ansible-tower


    【解决方案1】:

    我用谷歌搜索了很多,最后下面的配置对我有用。我已将 ntlm 添加到我的配置文件中。

    ansible_user: user@DOMAIN.COM
    ansible_password: password
    ansible_connection: winrm
    ansible_ssh_port: 5986
    ansible_winrm_transport: ntlm
    ansible_winrm_server_cert_validation: ignore
    

    【讨论】:

    • 感谢您的信息;无需添加ansible_ssh_port: 5986 btw。
    【解决方案2】:

    感谢作者ansible kerberos setup,在这篇文章之后得到这个工作,可能会帮助其他人:

    1. 安装 krb5-workstation、gcc、krb5-devel、krb5-libs、pip install kerberos, pip install requests_kerberos
    2. 按照文章先测试到windows的ansible连接
    3. 将组下的主机名更改为 FQDN 名称而不是 Tower 中的 ip。如果需要,您可以将 ansible_winrm_transport: kerberos 添加到变量中
    4. 重新启动作业。

    【讨论】:

      猜你喜欢
      • 2016-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-15
      • 1970-01-01
      • 2016-10-18
      • 1970-01-01
      相关资源
      最近更新 更多