I'm using ansible (ansible 1.9.0.1).
I'm running ansible-playbook to perform some operations on a target / remote machine using it's hostname.
My inventory file has an entry for a hostname i.e. appserver01.newdomainname.com
When I run ansible-playbook to just do a simple (hello world example), it doesn't resolve the hostname. If in the inventory file, I have the x.x.x.x IP, then it works!!!!
So, it seems like the nameserver or search in my source machine's /etc/resolv.conf is not resolving the remote hostname using it's fully qualified domain name i.e. appserver01.newdomainname.com
Is there any way I can call ansible-playbook and pass the new/local DNS server so that ansible can resolve the hostname (in the inventory file) from that DNS first (instead of reading / resolving it from the /etc/resolv.conf).
PS: I can't add this new/local DNS nameserver xx.xx.yy.zz to /etc/resolv.conf.
.ssh/config
, is an ssh tunnel (ProxyCommand
). If you delegate all tasks through a host from where the target hosts are resolvable the hostnames don't need to be resolvable locally. – udondanssh appserver01.newdomainname.com
from your master, does that work? – Mxx