bundlewrap/bundles/systemd-networkd/items.py

23 lines
529 B
Python

assert node.has_bundle('systemd')
files = {
'/etc/network/interfaces': {},
}
for interface, config in node.metadata.get('interfaces', {}).items():
files['/etc/systemd/network/10-{}.network'.format(interface)] = {
'source': 'template.network',
'content_type': 'mako',
'context': {
'interface': interface,
'config': config,
},
'triggers': {
'svc_systemd:systemd-networkd:restart',
},
}
svc_systemd = {
'systemd-networkd': {},
}