bundles/wireguard: re-add reconnect script for added resiliency
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
13057d6f76
commit
8656f99f8e
2 changed files with 10 additions and 5 deletions
|
@ -4,9 +4,7 @@
|
|||
# it gets connected. Easiest way is to simply send some pings to the
|
||||
# other side.
|
||||
|
||||
% for peer, config in node.metadata.get('wireguard/peers', {}).items():
|
||||
% for ip in sorted(config['ips']):
|
||||
# refresh connection to ${peer} ${ip}
|
||||
/usr/bin/ping -c 4 ${ip.split('/')[0] if '/' in ip else ip}
|
||||
% endfor
|
||||
% for peer, config in sorted(node.metadata.get('wireguard/peers', {}).items()):
|
||||
# refresh connection to ${peer}
|
||||
/usr/bin/ping -c 4 ${config['their_ip']}
|
||||
% endfor
|
||||
|
|
|
@ -28,3 +28,10 @@ for number, (peer, config) in enumerate(sorted(node.metadata.get('wireguard/peer
|
|||
'svc_systemd:systemd-networkd:restart',
|
||||
},
|
||||
}
|
||||
|
||||
if node.has_bundle('pppd'):
|
||||
files['/etc/ppp/ip-up.d/reconnect-wireguard'] = {
|
||||
'source': 'pppd-ip-up',
|
||||
'content_type': 'mako',
|
||||
'mode': '0755',
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue