fabric: get mgmt gateway from custom field on prefix
Mainly so we can add IPv6 addresses to mgmt interfaces.
This commit is contained in:
parent
bc93f26a21
commit
9c35f0fa25
|
@ -14,11 +14,13 @@ iface {{ iface.name }}
|
|||
vrf mgmt
|
||||
ip-forward off
|
||||
ip6-forward off
|
||||
{% for ip in iface.ip_addresses | rejectattr('address', 'match', '^fe80::.*/64$' ) %}
|
||||
{% for ip in iface.ip_addresses %}
|
||||
address {{ ip.address }}
|
||||
{% endfor %}
|
||||
{% if iface.custom_fields.gateway %}
|
||||
gateway {{ iface.custom_fields.gateway.address | ipaddr('address') }}
|
||||
{% set subnet = ip.address | ipaddr('subnet') %}
|
||||
{% set prefix = prefixes | selectattr('prefix', '==', subnet) | first %}
|
||||
{% if prefix.custom_fields.gateway %}
|
||||
gateway {{ prefix.custom_fields.gateway.address | ipaddr('address') }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in a new issue