Don't make VLAN/VXLAN/MACVLAN mutually exclusive

Each interface can have multiple VLAN/VXLAN/MACVLAN at the same
time and these options are not mutually exclusive.

They are mutually exclusive though with Bridge/Bond options, as not
applicable when interface is part of the bridge or bond.

Change-Id: Ife417a4ec72b561f68bc60f5d5b179b82524ae7a
This commit is contained in:
Dmitriy Rabotyagov 2024-09-14 12:30:11 +02:00
parent 8a4a59afd9
commit 12a0da6ab8

View File

@ -40,7 +40,8 @@ Gateway={{ item.1.gateway }}
Bridge={{ item.1.bridge }} Bridge={{ item.1.bridge }}
{% elif item.1.bond is defined %} {% elif item.1.bond is defined %}
Bond={{ item.1.bond }} Bond={{ item.1.bond }}
{% elif item.1.vlan is defined %} {% else %}
{% if item.1.vlan is defined %}
{% if item.1.vlan is iterable and item.1.vlan is not string %} {% if item.1.vlan is iterable and item.1.vlan is not string %}
{% for vlan in item.1.vlan %} {% for vlan in item.1.vlan %}
VLAN={{ vlan }} VLAN={{ vlan }}
@ -48,11 +49,14 @@ VLAN={{ vlan }}
{% else %} {% else %}
VLAN={{ item.1.vlan }} VLAN={{ item.1.vlan }}
{% endif %} {% endif %}
{% elif item.1.macvlan is defined %} {% endif %}
{% if item.1.macvlan is defined %}
MACVLAN={{ item.1.macvlan }} MACVLAN={{ item.1.macvlan }}
{% elif item.1.vxlan is defined %} {% endif %}
{% if item.1.vxlan is defined %}
VXLAN={{ item.1.vxlan }} VXLAN={{ item.1.vxlan }}
{% endif %} {% endif %}
{% endif %}
{% if item.1.ipforward is defined %} {% if item.1.ipforward is defined %}
IPForward={{ (item.1.ipforward | bool) | ternary('yes', 'no') }} IPForward={{ (item.1.ipforward | bool) | ternary('yes', 'no') }}
{% endif %} {% endif %}