community.general.nios_next_ip – Return the next available IP address for a network¶
Note
This plugin is part of the community.general collection (version 1.3.6).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.nios_next_ip
.
Synopsis¶
Uses the Infoblox WAPI API to return the next available IP addresses for a given network CIDR
Requirements¶
The below requirements are needed on the local controller node that executes this lookup.
infoblox-client
Parameters¶
Notes¶
Note
This module must be run locally, which can be achieved by specifying
connection: local
.Please read the Infoblox Guide for more detailed information on how to use Infoblox with Ansible.
Examples¶
- name: return next available IP address for network 192.168.10.0/24
ansible.builtin.set_fact:
ipaddr: "{{ lookup('community.general.nios_next_ip', '192.168.10.0/24', 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('community.general.nios_next_ip', '192.168.10.0/24', num=3, provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
- name: return the next 3 available IP addresses for network 192.168.10.0/24 excluding ip addresses - ['192.168.10.1', '192.168.10.2']
ansible.builtin.set_fact:
ipaddr: "{{ lookup('community.general.nios_next_ip', '192.168.10.0/24', num=3, exclude=['192.168.10.1', '192.168.10.2'],
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 | Returned | Description |
---|---|---|
_list
list
/ elements=string
|
success |
The list of next IP addresses available
|
Authors¶
Unknown (!UNKNOWN)