Ansible on Windows (with credssp) running into issues.

688 views
Skip to first unread message

Vishnu V Potti

unread,
Aug 23, 2017, 3:02:47 AM8/23/17
to Ansible Project
Hi,

I am trying to control a windows 2016 server host using Ansible control machine( CentOS)


But I ran into issues and need help

Steps I followed.

1) Setup Ansible Controller machine in CentOS
2) Installed pip install "pywinrm>=0.2.2"
3) Installed pip install pywinrm[credssp]
4) Set up group_vars/windows.yml on my Ansible controller machine with contents as below

ansible_user: Administrator
ansible_password: RandomePassword
ansible_port: 5985
ansible_winrm_scheme: http
ansible_connection: credssp
# The following is necessary for Python 2.7.9+ (or any older Python that has backported SSLContext, eg, Python 2.7.5 on RHEL7) when using default WinRM self-signed certificates:
ansible_winrm_server_cert_validation: ignore


6) I ran command to test connection and I got error as shown below.

root@MycentOS # ansible [windowsIP] -m ping
windowsIP | FAILED! => {
    "failed": true,
    "msg": "the connection plugin 'credssp' was not found"
}

Can you please let me know what is going wrong.

Thanks,
Vishnu

Jordan Borean

unread,
Aug 23, 2017, 9:26:31 AM8/23/17
to Ansible Project
Hi

ansible_connection should be 'winrm' and you can set the auth mode using ansible_transport. So ultimately your vars should be;

ansible_user: Administrator
ansible_password: RandomePassword
ansible_port: 5985
ansible_winrm_scheme: http
ansible_connection: winrm
ansible_winrm_transport: credssp
ansible_winrm_server_cert_validation: ignore

One thing I would recommend is to use HTTPS instead of just HTTP. If you used the ConfigureRemotingForAnsible.ps1 script to set up WinRM you can just change ansible_port to 5986 and remove ansible_winrm_scheme to do this.

Thanks

Jordan
Reply all
Reply to author
Forward
0 new messages