diff --git a/bundles/systemd-networkd/files/template-bond.network b/bundles/systemd-networkd/files/template-bond.network index e7849fa..2d10582 100644 --- a/bundles/systemd-networkd/files/template-bond.network +++ b/bundles/systemd-networkd/files/template-bond.network @@ -3,3 +3,7 @@ Name=${' '.join(sorted(match))} [Network] Bond=${bond} + +% for vlan in sorted(vlans): +VLAN=${bond}.${vlan} +% endfor diff --git a/bundles/systemd-networkd/files/template-bridge.network b/bundles/systemd-networkd/files/template-bridge.network index 0487f79..c6108d1 100644 --- a/bundles/systemd-networkd/files/template-bridge.network +++ b/bundles/systemd-networkd/files/template-bridge.network @@ -3,3 +3,7 @@ Name=${' '.join(sorted(match))} [Network] Bridge=${bridge} + +% for vlan in sorted(vlans): +VLAN=${bridge}.${vlan} +% endfor diff --git a/bundles/systemd-networkd/items.py b/bundles/systemd-networkd/items.py index 72123d6..14565b7 100644 --- a/bundles/systemd-networkd/items.py +++ b/bundles/systemd-networkd/items.py @@ -89,6 +89,7 @@ for bond, config in node.metadata.get('systemd-networkd/bonds', {}).items(): 'context': { 'bond': bond, 'match': config['match'], + 'vlans': node.metadata.get(f'interfaces/{bond}/vlans', set()), }, 'needed_by': { 'svc_systemd:systemd-networkd', @@ -118,6 +119,7 @@ for brname, config in node.metadata.get('systemd-networkd/bridges', {}).items(): 'context': { 'bridge': brname, 'match': config['match'], + 'vlans': node.metadata.get(f'interfaces/{brname}/vlans', set()), }, 'needed_by': { 'svc_systemd:systemd-networkd',