bundles/systemd-networkd: combine templates for interfaces
This commit is contained in:
parent
e27e374983
commit
53ff288d89
3 changed files with 26 additions and 38 deletions
|
@ -40,9 +40,7 @@ for interface, config in node.metadata.get('interfaces').items():
|
|||
if config.get('dhcp', False):
|
||||
if 'vlans' in config:
|
||||
raise BundleError(f'{node.name} interface {interface} cannot use vlans and dhcp!')
|
||||
template = 'template-iface-dhcp.network'
|
||||
else:
|
||||
template = 'template-iface-nodhcp.network'
|
||||
all_interfaces_use_dhcp = False
|
||||
|
||||
if '.' in interface:
|
||||
|
@ -80,7 +78,7 @@ for interface, config in node.metadata.get('interfaces').items():
|
|||
|
||||
if not config.get('ignore', False):
|
||||
files[f'/etc/systemd/network/{interface}.network'] = {
|
||||
'source': template,
|
||||
'source': 'template-iface.network',
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'interface': interface,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue