Ansible and name resolution

Hello,

How do I perform name-to-IP lookups form within ansible YAML? Or even better, a Jinja template?

Thanks.

Using the ‘pipe’ lookup you can use the output of a command, e.g. " dig +short my.dns.name "

http://docs.ansible.com/playbooks_lookups.html#more-lookups

Apologies for double post. Didn’t realize forum was moderated for first posters.

Using the 'pipe' lookup you can use the output of a command, e.g. " dig
+short my.dns.name "

Charles' question, and Serge's response prompted me to finally get
something done about this. Test at your own risk. [1] :wink:

        -JP

[1] http://jpmens.net/2015/02/20/a-new-dns-lookup-plugin-for-ansible/

nice!

nice!

Submitted as PR #10311 https://github.com/ansible/ansible/pull/10311

IMO, dnstxt.py should be removed, and the docs updated to say

        Users of the previously-available `dnstxt` lookup-plugin should
        migrate to `dig` by changing

                lookup('dnstxt', 'example.com')

        to
                lookup('dig', 'example.com/TXT')

I hope that helps.

        -JP