Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 8 Next »

Use the nios_next_ip plug-in to fetch the next available IP addresses or IP address ranges 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.

network_view

Optional

Specifies the network view from which to retrieve the next available IP address.
If a value is not specified, the default network view configured in NIOS is used.

use_range

Optional

Specifies whether to retrieve the next available IPv4 or IPv6 addresses. The default value is false.
When you set this parameter to true, ensure that the configured number of IP addresses in the num parameter is between 1 and 20.

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 the list 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'}) }}"

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

  • No labels