You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we recently recreated our whole network as IPv6 only, we were surprised to have to rely on string editing to be able to fetch host parts/interface identifiers from complete addresses. Similar thing goes for address construction, where we have to rely on hex number as string to int conversion in conjunction with the nthhost filter to generate full addresses.
ISSUE TYPE
Feature Idea
COMPONENT NAME
What we'd like to have is a parameter within the ipaddr filter, that allows to grab the interface identifier as ::xxxx:xxxx:xxxx:xxxx address. E.g.: "2001:db8::1/64" | ansible.utils.ipaddr('identifier') resulting in "::1" optionally, when the prefix size is omitted on the address a default of 64 could be assumed or a certain size could be given via named parameter, e.g.: "2001:db8:1:1::1" | ansible.utils.ipaddr('identifier', prefix_size=48) resulting in "0:0:0:1::1".
To build addresses, something like an "addr_from" filter could be helpful to create addresses from interface identifiers and subnets.
ADDITIONAL INFORMATION
Grabbing the interface identifies would be helpful in static IP configurations where you want to fetch data specified in a separate dict and look that up by interface identifier. Especially for HA router configurations this makes a lot of sense, as they will "share" a common identifier.
Building addresses out of identifiers allows easy dynamic address creation by specifying an identifier per host in the inventory and building addresses of that.
SUMMARY
As we recently recreated our whole network as IPv6 only, we were surprised to have to rely on string editing to be able to fetch host parts/interface identifiers from complete addresses. Similar thing goes for address construction, where we have to rely on hex number as string to int conversion in conjunction with the
nthhost
filter to generate full addresses.ISSUE TYPE
COMPONENT NAME
What we'd like to have is a parameter within the
ipaddr
filter, that allows to grab the interface identifier as::xxxx:xxxx:xxxx:xxxx
address. E.g.:"2001:db8::1/64" | ansible.utils.ipaddr('identifier')
resulting in"::1"
optionally, when the prefix size is omitted on the address a default of 64 could be assumed or a certain size could be given via named parameter, e.g.:"2001:db8:1:1::1" | ansible.utils.ipaddr('identifier', prefix_size=48)
resulting in"0:0:0:1::1"
.To build addresses, something like an "addr_from" filter could be helpful to create addresses from interface identifiers and subnets.
ADDITIONAL INFORMATION
Grabbing the interface identifies would be helpful in static IP configurations where you want to fetch data specified in a separate dict and look that up by interface identifier. Especially for HA router configurations this makes a lot of sense, as they will "share" a common identifier.
Building addresses out of identifiers allows easy dynamic address creation by specifying an identifier per host in the inventory and building addresses of that.
The text was updated successfully, but these errors were encountered: