bundles/systemd-networkd: proper config
This commit is contained in:
parent
fbb4e2f7a5
commit
5e7c7671e0
3 changed files with 46 additions and 24 deletions
|
@ -1,10 +1,20 @@
|
|||
assert node.has_bundle('systemd')
|
||||
|
||||
files = {
|
||||
'/etc/network/interfaces': {},
|
||||
'/etc/network/interfaces': {
|
||||
'delete': True,
|
||||
},
|
||||
}
|
||||
|
||||
for interface, config in node.metadata.get('interfaces', {}).items():
|
||||
directories = {
|
||||
'/etc/systemd/network': {
|
||||
'purge': True,
|
||||
},
|
||||
}
|
||||
|
||||
# Don't use .get() here. We might end up with a node without a network
|
||||
# config!
|
||||
for interface, config in node.metadata['interfaces'].items():
|
||||
files['/etc/systemd/network/10-{}.network'.format(interface)] = {
|
||||
'source': 'template.network',
|
||||
'content_type': 'mako',
|
||||
|
@ -12,6 +22,9 @@ for interface, config in node.metadata.get('interfaces', {}).items():
|
|||
'interface': interface,
|
||||
'config': config,
|
||||
},
|
||||
'needed_by': {
|
||||
'svc_systemd:systemd-networkd',
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:systemd-networkd:restart',
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue