Your set_fact task is setting 'lookup('dig', inventory_hostname)' as a literal string, you will to use braces so it actually interprets the lookup, e.g.
- set_fact: target_ip: '{{ lookup("dig", inventory_hostname) }}' In the future you are better off posting in the Ansible Project mailing like, Ansible Development is for Ansible engine and plugin development questions not using Ansible. Thanks Jordan -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/496ae909-178c-4fcd-b59b-0fcff5baf005%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.