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:
weight = 50
files['/etc/systemd/network/{}-iface-{}.network'.format(weight, interface)] = {
'source': template,
'content_type': 'mako',
'context': {
'interface': interface,
'config': config,
},
'needed_by': {
'svc_systemd:systemd-networkd',
},
'triggers': {
'svc_systemd:systemd-networkd:restart',
},
}
if not config.get('ignore', False):
files['/etc/systemd/network/{}-iface-{}.network'.format(weight, interface)] = {
'source': template,
'content_type': 'mako',
'context': {
'interface': interface,
'config': config,
},
'needed_by': {
'svc_systemd:systemd-networkd',
},
'triggers': {
'svc_systemd:systemd-networkd:restart',
},
}
for bond, config in node.metadata.get('systemd-networkd', {}).get('bonds', {}).items():
files['/etc/systemd/network/20-bond-{}.netdev'.format(bond)] = {