diff --git a/bundles/wireguard/items.py b/bundles/wireguard/items.py index 6d4461a..0a270d1 100644 --- a/bundles/wireguard/items.py +++ b/bundles/wireguard/items.py @@ -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', diff --git a/bundles/wireguard/metadata.py b/bundles/wireguard/metadata.py index ed5a8fa..3c055ba 100644 --- a/bundles/wireguard/metadata.py +++ b/bundles/wireguard/metadata.py @@ -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, - }, - }