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.2.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.

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

New in version 1.0.0: of infoblox.nios_modules

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

Parameters

Parameter

Comments

_terms

string / required

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

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.

Default: 24

exclude

list / elements=string

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

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 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 Values

Common return values are documented here, the following are the fields unique to this lookup:

Key

Description

_list

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.