I am trying to do a POC on Ansible first time.I am using RHEL as a master and Windows 2012 as a client .Installed ansible 2.7 in RHEL and winrm in windows and done inventory entries in RHEL .
i am getting below error.Kindly help …
ERROR
[root@Amaster group_vars]# ansible web -i inventory.yml -m win_ping
18.224.135.4 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: ssh: connect to host 18.224.135.4 port 22: Connection timed out\r\n”,
“unreachable”: true
By default ansible will use ssh connection which tries to connect to port 22 even if the target host is windows.
In order to tell ansible to connect using winrm which uses port 5985(non-ssl)/5986(ssl), you have to add these variable/settings to your inventory file
Thanks for your mail.I tried the one which you suggested still not working.actually our windows are using public ip and its not in domain.will that cause issue?