- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Ansible lookup for ipv4addr not returning all entries
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 11:53 AM
When I try to fetch all IPv4 records in Infoblox using the Ansible collection as below, it returns a subset of all the IPs
- name: Fetch all host DNS records from Infoblox set_fact: all_infoblox_interfaces: "{{ lookup('nios', 'record:host_ipv4addr', provider=nios_provider) }}"
However when I try to apply a filter on this search for a specific IP (in the interface variable), I can see the record being returned. How can I modify the lookup to return all IPv4 addresses?
- name: Fetch all host DNS records from Infoblox set_fact: all_infoblox_interfaces: "{{ lookup('nios', 'record:host_ipv4addr', filter={'ipv4addr': interface}, provider=nios_provider)}}"
Solved! Go to Solution.
Re: Ansible lookup for ipv4addr not returning all entries
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 04:56 AM
I'm not very experienced with the Ansible collection, but it seems to me that the Ansible lookup routine is designed only to look for host records, and will not return all record types. If you're more interested in other record types, you may be better off using direct WAPI calls, or the Python infoblox-client module.
Re: Ansible lookup for ipv4addr not returning all entries
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2024 02:15 PM
Thanks, I could accomplish the same using Python infoblox-client library
from infoblox_client import connector conn = connector.Connector(opts) ipv4_records = conn.get_object("record:host_ipv4addr", max_results=10000)