bundles/systemd-networkd: remove usage of systemd-resolved
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good

Something in the combination of arch+zfs+netctl+resolved+ipv6 leads to
hanging dns, which in turn leads to hanging everything.
This commit is contained in:
Franzi 2022-04-03 09:01:10 +02:00
parent 891823376f
commit 4823653214
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 12 additions and 15 deletions

View file

@ -80,9 +80,6 @@ defaults = {
'xdotool': {}, # needed for maim window selection
},
},
'systemd-networkd': {
'enable-resolved': True,
},
}
@metadata_reactor.provides(

View file

@ -10,16 +10,12 @@ files = {
svc_systemd = {
'systemd-networkd': {},
'systemd-resolved': {
'running': False,
'enabled': False,
},
}
if node.metadata.get('systemd-networkd/enable-resolved', False):
svc_systemd['systemd-resolved'] = {}
else:
files['/etc/resolv.conf'] = {
'content_type': 'mako',
}
directories = {
'/etc/systemd/network': {
'purge': True,
@ -34,16 +30,16 @@ directories = {
mac_host_prefix = '%04x' % (node.magic_number % 65534)
generated_mac = f'52:54:00:{mac_host_prefix[0:2]}:{mac_host_prefix[2:4]}:{{}}'
all_interfaces_use_dhcp = 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():
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:
vlan_id = int(interface.split('.')[1])
@ -94,6 +90,11 @@ for interface, config in node.metadata['interfaces'].items():
},
}
if not all_interfaces_use_dhcp:
files['/etc/resolv.conf'] = {
'content_type': 'mako',
}
for bond, config in node.metadata.get('systemd-networkd/bonds', {}).items():
files[f'/etc/systemd/network/{bond}.netdev'] = {
'source': 'template-bond.netdev',

View file

@ -80,7 +80,6 @@ nodes['kunsi-t470'] = {
'install_gui': True,
},
'systemd-networkd': {
'enable-resolved': True,
'bridges': {
'br0': {
'match': {