ansible / ansible.utils / 4.0.0 / filter / previous_nth_usable This filter returns the previous nth usable ip within a network described by value. | "added in version" 2.5.0 of ansible.utils" Authors: Ashwini Mhatre (@amhatre)ansible.utils.previous_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 previous nth usable ip within a network described by value.
Use previous_nth_usable to find the previous nth usable IP address in relation to another within a range
#### examples - name: previous_nth_usable returns the second usable IP address for the given IP range debug: msg: "{{ '192.168.122.10/24' | ansible.utils.previous_nth_usable(2) }}"
- name: If there is no usable address, it returns an empty string. debug: msg: "{{ '192.168.122.1/24' | ansible.utils.previous_nth_usable(2) }}"
value: description: - subnets or individual address input for previous_nth_usable plugin required: true type: str offset: description: - index value - previous nth usable IP address type: int
data: description: - Returns the previous nth usable ip within a network described by value. type: str