ansible / ansible.utils / 4.0.0 / filter / ipv6 To filter only Ipv6 addresses Ipv6 filter is used. | "added in version" 2.5.0 of ansible.utils" Authors: Ashwini Mhatre (@amhatre)ansible.utils.ipv6 (4.0.0) — filter
Install with ansible-galaxy collection install ansible.utils:==4.0.0
collections: - name: ansible.utils version: 4.0.0
Sometimes you need only IPv6 addresses. To filter only Ipv6 addresses Ipv6 filter is used.
#### examples # Ipv6 filter plugin with different queries. - name: Set value as input list ansible.builtin.set_fact: value: - 192.24.2.1 - ::ffff:192.168.32.0/120 - '' - ::ffff:192.24.2.1/128 - 192.168.32.0/24 - fe80::100/10 - true
- name: IPv6 filter to filter Ipv6 Address debug: msg: "{{ value|ansible.utils.ipv6 }}"
- name: convert IPv6 addresses into IPv4 addresses. debug: msg: "{{ value|ansible.utils.ipv6('ipv4') }}"
- name: filter only IPv6 addresses. debug: msg: "{{ value|ansible.utils.ipv6('address') }}"
query: default: '' description: - You can provide a single argument to each ipv6() filter. - Example. query type 'ipv4' to convert ipv6 into ipv4 type: str value: description: - list of subnets or individual address or any other values input for ipv6 plugin required: true type: raw
data: description: - Returns values valid for a particular query. type: raw