ansible / ansible.utils / 4.0.0 / filter / nthhost This filter returns the nth host within a network described by value. | "added in version" 2.5.0 of ansible.utils" Authors: Ashwini Mhatre (@amhatre)ansible.utils.nthhost (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 nth host within a network described by value. To return the nth ip from a network, use the filter nthhost.
Nthhost also supports a negative value.
#### examples - name: To return the nth ip from a network, use the filter nthhost. debug: msg: "{{ '10.0.0.0/8' | ansible.utils.nthhost(305) }}"
- name: nthhost also supports a negative value. debug: msg: "{{ '10.0.0.0/8' | ansible.utils.nthhost(-1) }}"
query: description: nth host type: str value: description: The network address or range to test against. required: true type: str
data: description: - Returns nth host from network type: str