exit: sort prefixes by family values

Because I made some seemingly unrelated changes in NetBox and they all
got flipped‐turned upside down.
This commit is contained in:
Timotej Lazar 2024-04-09 10:47:51 +02:00
parent 000f625988
commit ece3b8a377
2 changed files with 3 additions and 2 deletions

View file

@ -13,7 +13,7 @@ iface {{ vlan.name }}
# Interfaces.
{% for vlan in bridge_vlans %}
{% set prefixes = query('netbox.netbox.nb_lookup', 'prefixes', api_filter='vlan_id='~vlan.id, raw_data=true)
| map(attribute='prefix') %}
| sort(attribute='family.value') | map(attribute='prefix') %}
auto {{ bridge.name }}.{{ vlan.vid }}
iface {{ bridge.name }}.{{ vlan.vid }}
vrf {% if vlan.role.slug == 'outside' %}outside{% else %}{{ vlan.name }}{% endif +%}