Skip to content

Instantly share code, notes, and snippets.

@parberge
Last active February 14, 2017 08:54
Show Gist options
  • Save parberge/83c6fa21625b4acbdb797bc40a8a68be to your computer and use it in GitHub Desktop.
Save parberge/83c6fa21625b4acbdb797bc40a8a68be to your computer and use it in GitHub Desktop.
ansible lookup(dig)
task:
- name: "Check DNS records for host"
set_fact:
dns_a_record: "{{ lookup('dig', ansible_fqdn) }}"
dns_ptr_record: "{{ lookup('dig', ansible_default_ipv4['address'] + '/PTR') }}"
output:
TASK [core : Check DNS records for host] ***************************************
fatal: [xxxx]: FAILED! => {"failed": true, "msg": "dns.resolver unhandled exception"}
to retry, use: --limit @/tmp/ansible/retry-files/baseline.retry
@parberge
Copy link
Author

$ ansible --version
ansible 2.2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment