bundles/systemd-networkd: fix vlan support for bridges and bonds

This commit is contained in:
Franzi 2021-04-10 09:14:12 +02:00
parent 913f2cde8f
commit 02146a81d6
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 10 additions and 0 deletions

View file

@ -3,3 +3,7 @@ Name=${' '.join(sorted(match))}
[Network] [Network]
Bond=${bond} Bond=${bond}
% for vlan in sorted(vlans):
VLAN=${bond}.${vlan}
% endfor

View file

@ -3,3 +3,7 @@ Name=${' '.join(sorted(match))}
[Network] [Network]
Bridge=${bridge} Bridge=${bridge}
% for vlan in sorted(vlans):
VLAN=${bridge}.${vlan}
% endfor

View file

@ -89,6 +89,7 @@ for bond, config in node.metadata.get('systemd-networkd/bonds', {}).items():
'context': { 'context': {
'bond': bond, 'bond': bond,
'match': config['match'], 'match': config['match'],
'vlans': node.metadata.get(f'interfaces/{bond}/vlans', set()),
}, },
'needed_by': { 'needed_by': {
'svc_systemd:systemd-networkd', 'svc_systemd:systemd-networkd',
@ -118,6 +119,7 @@ for brname, config in node.metadata.get('systemd-networkd/bridges', {}).items():
'context': { 'context': {
'bridge': brname, 'bridge': brname,
'match': config['match'], 'match': config['match'],
'vlans': node.metadata.get(f'interfaces/{brname}/vlans', set()),
}, },
'needed_by': { 'needed_by': {
'svc_systemd:systemd-networkd', 'svc_systemd:systemd-networkd',