There seems to be an issue trying to connect to my host using their fully qualified domain name (FQDN). I can ping each host with Ansible using their respective IP Addresses but whenever I try using the FQDN I get this error:
I have already configured WinRM and have installed packages onto Windows PCs so I know the connection works. I can ping the host from the Windows command line using the FQDN with no issues but when I try it from my Ansible control node (which is on the same PC) I keep getting the error above. I’m wondering whether I have not configured something correctly or if Ansible is just unable to reach the host due to some firewall restriction.
Here is an example of what my inventory looks like:
Make sure that my-host1 is able to be resolved (via DNS or host entry). For https it is also important that your winrm listener is listening on this hostname and that the certificate matches:
winrm enumerate winrm/config/listener
Listener
Address = *
Transport = HTTPS
Port = 5986
Hostname = my-host1
ListeningOn = xxx.xxx.xxx.xxx
...
I was able to fix the issue by adding the correct DNS IP address to my resolv.conf file. Thank you, guys, for your responses they definitely helped guide me to the solution.