>From the error message it seems like the WinRM endpoint is not enabled on the remote server hence the Failed to establish a new connection error. Try and use this script to set up the WinRM endpoint on your server https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1.
Once you have done that you should have the following entries in your inventory/group_vars ansible_user: user@DOMAIN ansible_password: password ansible_port: 5986 ansible_connection: winrm ansible_winrm_cert_validation: ignore On Tuesday, May 2, 2017 at 4:20:55 AM UTC+10, Anurag Tripathi wrote: > > I am new to Ansible and trying to connect to windows machine using > Ansible. I am getting following error: > > cic-svr-reiis02.corp.exlservice.com | UNREACHABLE! => { > "changed": false, > "msg": "plaintext: HTTPConnectionPool(host=' > cic-svr-reiis02.corp.exlservice.com', port=5985): Max retries exceeded > with url: /wsman (Caused by > NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection > object at 0x3d76050>: Failed to establish a new connection: [Errno 111] > Connection refused',))", > "unreachable": true > } > > I have made changes in these three files. > > 1. > > Inventory: > > [windows] > xxx.xxx.xxx.com > 2. > > > 3. > > Krb5.conf > > [realms] > XXX.XXX.COM = { > kdc = xxx.xxx.xxx.com > admin_server = xxx.xxx.xxx.com > } > [domain_realm] > .xxx.xxx.com = XXX.XXX.COM > 4. > > > 5. > > group_vars/windows.yml > > ansible_ssh_user: user > ansible_ssh_pass: password > ansible_ssh_port: 5985 > ansible_connection: winrm > > > I am new to this and may have made mistake in the process of connectivity. > Any help would be appreciated. Thanks in advance. > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2f317fee-9c13-4175-81c6-a1bb373fdbe6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.