ansible.utils.ipsubnet (4.0.0) — filter

This filter can be used to manipulate network subnets in several ways.

| "added in version" 2.5.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 can be used to manipulate network subnets in several ways.

Inputs

    
index:
    description: 'The second argument of the ipsubnet() filter is an index number; by
      specifying it you can get a new subnet

      with the specified index.

      '
    type: int

query:
    default: ''
    description: 'You can provide query as 1st argument.

      To check if a given string is a subnet, pass it through the filter without any arguments.
      If the given

      string is an IP address, it will be converted into a subnet.

      If you specify a subnet size as the first parameter of the ipsubnet() filter, and
      the subnet size is

      smaller than the current one, you will get the number of subnets a given subnet
      can be split into.

      '
    type: str

value:
    description:
    - subnets or individual address or any other values input for ipsubnet plugin
    required: true
    type: str

Outputs

data:
  description:
  - Returns values valid for a particular query.
  type: raw