Compare commits
No commits in common. "0ed4973894ceee0884e0d9d1af527900c3aed7f9" and "bc93f26a2131b717a7a638cc14b334d122291c5a" have entirely different histories.
0ed4973894
...
bc93f26a21
3 changed files with 8 additions and 14 deletions
|
@ -68,10 +68,8 @@ interface {{ iface.name }}
|
||||||
{# store management address and gateway for later #}
|
{# store management address and gateway for later #}
|
||||||
{%- if iface.mgmt_only and iface.ip_addresses %}
|
{%- if iface.mgmt_only and iface.ip_addresses %}
|
||||||
{% set mgmt.ip = iface.ip_addresses[0].address %}
|
{% set mgmt.ip = iface.ip_addresses[0].address %}
|
||||||
{% set subnet = mgmt.ip | ipaddr('subnet') %}
|
{% if iface.custom_fields.gateway %}
|
||||||
{% set prefix = prefixes | selectattr('prefix', '==', subnet) | first %}
|
{% set mgmt.gw = iface.custom_fields.gateway.address %}
|
||||||
{% if prefix.custom_fields.gateway %}
|
|
||||||
{% set mgmt.gw = prefix.custom_fields.gateway.address %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,8 @@ interface {{ iface.name }}
|
||||||
{% if iface.ip_addresses %}
|
{% if iface.ip_addresses %}
|
||||||
{% set address = iface.ip_addresses | map(attribute='address') | first %}
|
{% set address = iface.ip_addresses | map(attribute='address') | first %}
|
||||||
ip address {{ address | ipaddr('address') }} {{ address | ipaddr('netmask') }}
|
ip address {{ address | ipaddr('address') }} {{ address | ipaddr('netmask') }}
|
||||||
{% set subnet = address | ipaddr('subnet') %}
|
{% if iface.custom_fields.gateway %}
|
||||||
{% set prefix = prefixes | selectattr('prefix', '==', subnet) | first %}
|
gateway {{ iface.custom_fields.gateway.address | ipaddr('address') }}
|
||||||
{% if prefix.custom_fields.gateway %}
|
|
||||||
gateway {{ prefix.custom_fields.gateway.address | ipaddr('address') }}
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
|
|
@ -14,13 +14,11 @@ iface {{ iface.name }}
|
||||||
vrf mgmt
|
vrf mgmt
|
||||||
ip-forward off
|
ip-forward off
|
||||||
ip6-forward off
|
ip6-forward off
|
||||||
{% for ip in iface.ip_addresses %}
|
{% for ip in iface.ip_addresses | rejectattr('address', 'match', '^fe80::.*/64$' ) %}
|
||||||
address {{ ip.address }}
|
address {{ ip.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 %}
|
||||||
|
{% if iface.custom_fields.gateway %}
|
||||||
|
gateway {{ iface.custom_fields.gateway.address | ipaddr('address') }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in a new issue