ansible.utils.ipv6form (4.0.0) — filter

This filter is designed to convert ipv6 address in different formats. For example expand, compressetc.

| "added in version" 2.11.0 of ansible.utils"

Authors: Ashwini Mhatre (@amhatre)

Install collection

Install with ansible-galaxy collection install ansible.utils:==4.0.0


Add to requirements.yml

  collections:
    - name: ansible.utils
      version: 4.0.0

Description

This filter is designed to convert ipv6 addresses in different formats.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
#### examples
# Ipv6form filter plugin with different format.
- name: Expand given Ipv6 address
  debug:
      msg: "{{ '1234:4321:abcd:dcba::17' | ansible.utils.ipv6form('expand') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Compress  given Ipv6 address
  debug:
      msg: "{{ '1234:4321:abcd:dcba:0000:0000:0000:0017' | ansible.utils.ipv6form('compress') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Covert given Ipv6 address in x509
  debug:
      msg: "{{ '1234:4321:abcd:dcba::17' | ansible.utils.ipv6form('x509') }}"

Inputs

    
value:
    description:
    - individual ipv6 address input for ipv6_format plugin.
    required: true
    type: str

format:
    choices:
    - compress
    - expand
    - x509
    description: Different formats example. compress, expand, x509
    type: str

Outputs

data:
  description:
  - Returns result ipv6 address in expected format.
  type: str