Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Use the nios_next_ip plug-in to fetch the next available IP address for a specified network CIDR. The plug-in uses the Infoblox WAPI to return the IP address.

The following table describes the parameters you can define in the nios_next_ip plug-in:

Parameter

Required/Optional

Description

terms

Required

Specifies the CIDR network to retrieve the next address or set of addresses from.

num

Optional

Specifies the number of IP addresses to return. The default value is 1.

exclude

Optional

Specifies the list of IP addresses to be excluded from the returned IP addresses.

provider

Required

Defines the details of the connection:

  • host: The DNS host name or IP address to connect to the remote instance of NIOS.

  • username: The user name to use for authenticating the connection to the remote instance.

  • password: The password to use for authenticating the connection to the remote instance.

For information on additional fields you can define,

see

see the list

of subparameters

of subparameters in the NIOS Modules for Ansible Collections topic.

connection

Required

The nios_next_ip module must be run locally.

Examples

name: return next available IP address for network 192.168.10.0/24
ansible.builtin.set_fact:
  ipaddr: "{{ lookup('infoblox.nios_modules.nios_next_ip', '192.168.10.0/24', provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"

name: return next available IP address for network fd30:f52:2:12::/64
ansible.builtin.set_fact:
  ipaddr: "{{ lookup('infoblox.nios_modules.nios_next_ip', 'fd30:f52:2:12::/64', provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"

name: return the next 3 available IP addresses for network 192.168.10.0/24
ansible.builtin.set_fact:
  ipaddr: "{{ lookup('infoblox.nios_modules.nios_next_ip', '192.168.10.0/24', num=3,
provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"