ansible / ansible.utils / 4.0.0 / filter / next_nth_usable This filter returns the next nth usable ip within a network described by value. | "added in version" 2.5.0 of ansible.utils" Authors: Ashwini Mhatre (@amhatre)ansible.utils.next_nth_usable (4.0.0) — filter
Install with ansible-galaxy collection install ansible.utils:==4.0.0
collections: - name: ansible.utils version: 4.0.0
This filter returns the next nth usable ip within a network described by value.
Use next_nth_usable to find the next nth usable IP address in relation to another within a range
#### examples # Ipv4 filter plugin with different queries. - name: next_nth_usable returns the second usable IP address for the given IP range debug: msg: "{{ '192.168.122.1/24' | ansible.utils.next_nth_usable(2) }}"
- name: If there is no usable address, it returns an empty string. debug: msg: "{{ '192.168.122.254/24' | ansible.utils.next_nth_usable(2) }}"
value: description: - subnets or individual address input for next_nth_usable plugin required: true type: str offset: description: - index value - next nth usable IP address type: int
data: description: - Returns the next nth usable ip within a network described by value. type: str