- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
How to list all containers with an EA that has a specific value?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2022 09:45 AM
Fist, an apology. I am new to using the NIOS WAPI. I may get some of the nomencleature wrong.
I'm looking for a way to use the Ansible nios_lookup module to extract a list of network containers where the EA "foo"="bar". I can do a similar lookup for networks whose VLAN=12, but I can't figure out how to convert the query for container searches.
- name: "Pull all networks with ansible_vlan=12" ansible.builtin.set_fact: all_vlan_12: >- {{ lookup('infoblox.nios_modules.nios_lookup', 'network', return_fields=['network'], filter={'*ansible_vlan': 12}, provider=nios_provider) }}
Is the nios_lookup module capable of something like this:
- name: "Pull all bar containers" ansible.builtin.set_fact: all_bar_containers: >- {{ lookup('infoblox.nios_modules.nios_lookup', 'container', return_fields=['container'], filter={'*foo': "bar"}, provider=nios_provider) }}
Also, is there a deeper dive on how to use the nios_lookup module than is provided in the Ansible nios_lookup documentation?
Thank you
Re: How to list all containers with an EA that has a specific value?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2022 03:54 PM
The object type is networkcontainer instead of container. This should work:
- name: "Pull all bar containers" ansible.builtin.set_fact: all_bar_containers: >- {{ lookup('infoblox.nios_modules.nios_lookup', 'networkcontainer', return_fields=['network'], filter={'*foo': "bar"}, provider=nios_provider) }}
For additional detailed documentation on the Infoblox Ansible Modules, take a look at the Infoblox Docs, and/or the Deployment Guide.