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 |
---|---|---|
| Required | Specifies the CIDR network to retrieve the next address or set of addresses from. |
| Optional | Specifies the network view from which to retrieve the next available IP address. |
| Optional | Specifies whether to retrieve the next available IPv4 or IPv6 addresses. The default value is |
| Optional | Specifies the number of IP addresses to return. The default value is |
| Optional | Specifies the list of IP addresses to be excluded from the returned IP addresses. |
| Required | Defines the details of the connection:
For information on additional fields you can define, see the list of subparameters in the NIOS Modules for Ansible Collections topic. |
| Required | The |
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'}) }}"