infoblox.nios_modules.nios_lookup (1.6.1) — lookup

Query Infoblox NIOS objects

| "added in version" 1.0.0 of infoblox.nios_modules"

Authors: unknown

Install collection

Install with ansible-galaxy collection install infoblox.nios_modules:==1.6.1


Add to requirements.yml

  collections:
    - name: infoblox.nios_modules
      version: 1.6.1

Description

Uses the Infoblox WAPI API to fetch NIOS specified objects. This lookup supports adding additional keywords to filter the return data and specify the desired set of returned fields.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: fetch all networkview objects
  ansible.builtin.set_fact:
    networkviews: "{{ lookup('infoblox.nios_modules.nios_lookup', 'networkview', provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: fetch the default dns view
  ansible.builtin.set_fact:
    dns_views: "{{ lookup('infoblox.nios_modules.nios_lookup', 'view', filter={'name': 'default'},
                   provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# all of the examples below use credentials that are  set using env variables
# export INFOBLOX_HOST=nios01
# export INFOBLOX_USERNAME=admin
# export INFOBLOX_PASSWORD=admin

- name: fetch all host records and include extended attributes
  ansible.builtin.set_fact:
    host_records: "{{ lookup('infoblox.nios_modules.nios_lookup', 'record:host', return_fields=['extattrs', 'name', 'view', 'comment']}) }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: use env variables to pass credentials
  ansible.builtin.set_fact:
    networkviews: "{{ lookup('infoblox.nios_modules.nios_lookup', 'networkview') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: get a host record
  ansible.builtin.set_fact:
    host: "{{ lookup('infoblox.nios_modules.nios_lookup', 'record:host', filter={'name': 'hostname.ansible.com'}) }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: get the authoritative zone from a non default dns view
  ansible.builtin.set_fact:
    host: "{{ lookup('infoblox.nios_modules.nios_lookup', 'zone_auth', filter={'fqdn': 'ansible.com', 'view': 'ansible-dns'}) }}"

Inputs

    
_terms:
    description:
    - The name of the network object to be returned from the Infoblox appliance.
    required: true
    type: str

filter:
    description: A dict object that is used to filter the returned objects.
    type: dict

extattrs:
    description: A dict object that is used to filter based on extensible attributes.
    type: dict

return_fields:
    description: The list of field names to return for the specified object.
    elements: str
    type: list

Outputs

obj_type:
  contains:
    obj_field:
      description:
      - One or more obj_type fields as specified by return_fields argument or the
        default set of fields as per the object type
  description:
  - The object type specified in the terms argument
  returned: always
  type: list