From f6b12fd69664e8378900c8a48a03e86d9dda2880 Mon Sep 17 00:00:00 2001 From: Jeltz Date: Sat, 27 Aug 2022 08:31:42 +0200 Subject: [PATCH] ifupdown2: add minimal support for bridges --- roles/ifupdown2/templates/interfaces.j2 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/roles/ifupdown2/templates/interfaces.j2 b/roles/ifupdown2/templates/interfaces.j2 index d61606c..63eba91 100644 --- a/roles/ifupdown2/templates/interfaces.j2 +++ b/roles/ifupdown2/templates/interfaces.j2 @@ -3,11 +3,27 @@ {% for name, iface in ifupdown2__interfaces.items() %} auto {{ name }} iface {{ name }} -{% for address in iface.addresses %} +{% for address in iface.addresses | default([]) %} address {{ address | ipaddr }} {% endfor %} {% for gateway in iface.gateways | default([]) %} gateway {{ gateway | ipaddr }} {% endfor %} +{% if iface.bridge_ports is defined %} + bridge-ports {{ iface.bridge_ports | join(" ") }} +{% endif %} +{% if iface.bridge_vlan_aware is defined %} + bridge-vlan-aware {{ iface.bridge_vlan_aware + | ternary("yes", "no") }} +{% endif %} +{% if iface.bridge_vids is defined %} + bridge-vids {{ iface.bridge_vids | join(",") }} +{% endif %} +{% if iface.vlan_id is defined %} + vlan-id {{ iface.vlan_id | int }} +{% endif %} +{% if iface.vlan_raw_device is defined %} + vlan-raw-device {{ iface.vlan_raw_device }} +{% endif %} {% endfor %}