New ansible support (again)

This commit is contained in:
Miha Frangež 2026-02-23 16:54:47 +01:00 committed by jetomit
parent 3ff4ed5a77
commit 518c3bc7b8
12 changed files with 33 additions and 33 deletions

View file

@ -32,12 +32,12 @@ snmp-server access public security-model usm priv read public
{% for iface in interfaces | sort(attribute="type.value") | sort(attribute="mgmt_only") %}
{% if iface.mgmt_only %}
{% for address in iface.ip_addresses %}
{% set subnet = address.address | ipaddr('subnet') %}
{% set subnet = address.address | ansible.utils.ipaddr('subnet') %}
{% set prefix = prefixes | selectattr('prefix', '==', subnet) | first %}
{% if address.family.value == 4 %}
management ip address {{ address.address }}
{% if prefix.custom_fields.gateway %}
management route add gateway {{ prefix.custom_fields.gateway.address | ipaddr('address') }}
management route add gateway {{ prefix.custom_fields.gateway.address | ansible.utils.ipaddr('address') }}
{% endif %}
{% else %}
management ipv6 address {{ address.address }}