bundles/systemd-networkd: add option to only create a .netdev file for interfaces
This commit is contained in:
parent
be2cdc39e8
commit
b1860b7e01
1 changed files with 15 additions and 14 deletions
|
@ -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)] = {
|
||||
|
|
Loading…
Reference in a new issue