codeaffen.phpipam.is_subnet filter – Check if a subnet belongs to another

Note

This filter plugin is part of the codeaffen.phpipam collection (version 1.7.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install codeaffen.phpipam.

To use it in a playbook, specify: codeaffen.phpipam.is_subnet.

New in codeaffen.phpipam 1.2.0

Synopsis

  • First argument is a subnet second another. If the first subnet belongs to second

Input

This describes the input of the filter, the value before | codeaffen.phpipam.is_subnet.

Parameter

Comments

Input

string / required

Subnet in cidr format which should belongs to parent

Positional parameters

This describes positional parameters of the filter. These are the values positional1, positional2 and so on in the following example: input | codeaffen.phpipam.is_subnet(positional1, positional2, ...)

Parameter

Comments

parent

string / required

Subnet where input should belongs to

Examples

192.0.2.0/25 | codeaffen.phpipam.is_subnet(192.0.2.0/24)

Return Value

Key

Description

Return value

boolean

True if children belongs to parent and false if not or both networks are the same.

Returned: success

Authors

  • Christian Meißner

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.