Reply

How to list all containers with an EA that has a specific value?

New Member
Posts: 1
1691     0

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?

Superuser
Posts: 65
1692     0

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.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You