diff --git a/templates/systemd-network.j2 b/templates/systemd-network.j2 index 75fca96..80af49d 100644 --- a/templates/systemd-network.j2 +++ b/templates/systemd-network.j2 @@ -40,18 +40,22 @@ Gateway={{ item.1.gateway }} Bridge={{ item.1.bridge }} {% elif item.1.bond is defined %} Bond={{ item.1.bond }} -{% elif item.1.vlan is defined %} -{% if item.1.vlan is iterable and item.1.vlan is not string %} -{% for vlan in item.1.vlan %} +{% else %} +{% if item.1.vlan is defined %} +{% if item.1.vlan is iterable and item.1.vlan is not string %} +{% for vlan in item.1.vlan %} VLAN={{ vlan }} -{% endfor %} -{% else %} +{% endfor %} +{% else %} VLAN={{ item.1.vlan }} +{% endif %} {% endif %} -{% elif item.1.macvlan is defined %} +{% if item.1.macvlan is defined %} MACVLAN={{ item.1.macvlan }} -{% elif item.1.vxlan is defined %} +{% endif %} +{% if item.1.vxlan is defined %} VXLAN={{ item.1.vxlan }} +{% endif %} {% endif %} {% if item.1.ipforward is defined %} IPForward={{ (item.1.ipforward | bool) | ternary('yes', 'no') }}