2024-03-19 08:45:23 +00:00
|
|
|
{% set prefixes = query('netbox.netbox.nb_lookup', 'prefixes', raw_data=true) -%}
|
2023-12-18 10:22:14 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
{% for vlan in vlans %}
|
|
|
|
{% set vlan_prefixes = prefixes | selectattr('vlan') | selectattr('vlan.id', '==', vlan.id) | map(attribute='prefix') %}
|
|
|
|
"{{ vlan.name }}": {
|
|
|
|
"ip": {{ vlan_prefixes | ipv4 | to_json }},
|
|
|
|
"ip6": {{ vlan_prefixes | ipv6 | to_json }}
|
|
|
|
}{% if not loop.last %},{% endif +%}
|
|
|
|
{% endfor %}
|
|
|
|
}
|