alpine: don’t set gateway for interface if the gateway is that interface
This commit is contained in:
parent
6e35a7462d
commit
38ff061f81
|
@ -9,7 +9,7 @@ iface {{ iface.name }} inet static
|
|||
{% set subnet = ip.address | ipaddr('subnet') %}
|
||||
{% set prefix = prefixes | selectattr('prefix', '==', subnet) | first %}
|
||||
{% set gateway = prefix.custom_fields.gateway.address %}
|
||||
{% if gateway is defined %}
|
||||
{% if gateway is defined and gateway != ip.address %}
|
||||
gateway {{ gateway | ipaddr('address') }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in a new issue