bundles/wireguard: remove wg_health_check

This commit is contained in:
Franzi 2023-12-10 15:19:41 +01:00
parent f3269ce979
commit 86b8cd8edf
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 0 additions and 45 deletions

View file

@ -35,14 +35,6 @@ for peer, config in sorted(node.metadata.get('wireguard/peers', {}).items()):
},
}
files['/usr/local/bin/wg_health_check'] = {
'content_type': 'mako',
'context': {
'peers': node.metadata.get('wireguard/health_checks'),
},
'mode': '0755',
}
if node.has_bundle('pppd'):
files['/etc/ppp/ip-up.d/reconnect-wireguard'] = {
'source': 'pppd-ip-up',

View file

@ -306,40 +306,3 @@ def snat(metadata):
},
},
}
@metadata_reactor.provides(
'wireguard/health_checks',
'systemd-timers/timers/wg-health-check',
)
def health_checks(metadata):
checks = {}
for peer, config in metadata.get('wireguard/peers', {}).items():
if (
config.get('exclude_from_monitoring', False)
or not config.get('auto_connection', True)
or 'endpoint' not in config
):
continue
checks[peer] = config['their_ip']
if checks:
timer = {
'wg-health-check': {
'command': '/usr/local/bin/wg_health_check',
'when': 'minutely',
},
}
else:
timer = {}
return {
'systemd-timers': {
'timers': timer,
},
'wireguard': {
'health_checks': checks,
},
}