infoblox.nios_modules.nios_next_network lookup – Return the next available network range for a network-container

Note

This lookup plugin is part of the infoblox.nios_modules collection (version 1.4.1).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install infoblox.nios\_modules. You need further requirements to be able to use this lookup plugin, see Requirements for details.

To use it in a playbook, specify: infoblox.nios_modules.nios_next_network.

New in infoblox.nios_modules 1.0.0

Synopsis

  • Uses the Infoblox WAPI API to return the next available network addresses for a given network CIDR

Requirements

The below requirements are needed on the local controller node that executes this lookup.

  • infoblox_client

Terms

Parameter

Comments

Terms

string / required

The CIDR network to retrieve the next network from next available network within the specified container.

Parameters

Parameter

Comments

cidr

string / required

The CIDR of the network to retrieve the next network from next available network within the specified container. Also, Requested CIDR must be specified and greater than the parent CIDR.

exclude

list / elements=string

Network addresses returned from network-container excluding list of user’s input network range.

Default: [""]

network_view

string

The network view to retrieve the CIDR network from.

Default: "default"

num

integer

The number of network addresses to return from network-container.

Default: 1

Examples

- name: return next available network for network-container 192.168.10.0/24
  ansible.builtin.set_fact:
    networkaddr: "{{ lookup('infoblox.nios_modules.nios_next_network', '192.168.10.0/24', cidr=25,
                        provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"

- name: return next available network for network-container 192.168.10.0/24 in a non-default network view
  ansible.builtin.set_fact:
    networkaddr: "{{ lookup('infoblox.nios_modules.nios_next_network', '192.168.10.0/24', cidr=25, network_view='ansible'
                        provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"

- name: return the next 2 available network addresses for network-container 192.168.10.0/24
  ansible.builtin.set_fact:
    networkaddr: "{{ lookup('infoblox.nios_modules.nios_next_network', '192.168.10.0/24', cidr=25, num=2,
                        provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"

- name: return the available network addresses for network-container 192.168.10.0/24 excluding network range '192.168.10.0/25'
  ansible.builtin.set_fact:
    networkaddr: "{{ lookup('infoblox.nios_modules.nios_next_network', '192.168.10.0/24', cidr=25, exclude=['192.168.10.0/25'],
                        provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"

Return Value

Key

Description

Return value

list / elements=string

The list of next network addresses available

Returned: always

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.