bundles/systemd-networkd: better dhcp support
This commit is contained in:
parent
5e7c7671e0
commit
91fd33cfa0
3 changed files with 20 additions and 8 deletions
|
@ -15,8 +15,13 @@ directories = {
|
|||
# Don't use .get() here. We might end up with a node without a network
|
||||
# config!
|
||||
for interface, config in node.metadata['interfaces'].items():
|
||||
if config.get('dhcp', False):
|
||||
template = 'template-dhcp.network'
|
||||
else:
|
||||
template = 'template.network'
|
||||
|
||||
files['/etc/systemd/network/10-{}.network'.format(interface)] = {
|
||||
'source': 'template.network',
|
||||
'source': template,
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'interface': interface,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue