bundles/systemd-networkd: add option to only create a .netdev file for interfaces

This commit is contained in:
Franzi 2020-11-13 21:40:44 +01:00
parent be2cdc39e8
commit b1860b7e01
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -49,20 +49,21 @@ for interface, config in node.metadata['interfaces'].items():
else: else:
weight = 50 weight = 50
files['/etc/systemd/network/{}-iface-{}.network'.format(weight, interface)] = { if not config.get('ignore', False):
'source': template, files['/etc/systemd/network/{}-iface-{}.network'.format(weight, interface)] = {
'content_type': 'mako', 'source': template,
'context': { 'content_type': 'mako',
'interface': interface, 'context': {
'config': config, 'interface': interface,
}, 'config': config,
'needed_by': { },
'svc_systemd:systemd-networkd', 'needed_by': {
}, 'svc_systemd:systemd-networkd',
'triggers': { },
'svc_systemd:systemd-networkd:restart', 'triggers': {
}, 'svc_systemd:systemd-networkd:restart',
} },
}
for bond, config in node.metadata.get('systemd-networkd', {}).get('bonds', {}).items(): for bond, config in node.metadata.get('systemd-networkd', {}).get('bonds', {}).items():
files['/etc/systemd/network/20-bond-{}.netdev'.format(bond)] = { files['/etc/systemd/network/20-bond-{}.netdev'.format(bond)] = {