From 782b375a2eb13c7d15e693a62a11b54e03524a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Sat, 6 Jul 2024 10:47:33 +0200 Subject: feat(roles/wireguard): restart interface if gateway is unreachable --- roles/wireguard/tasks/cron.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'roles') diff --git a/roles/wireguard/tasks/cron.yml b/roles/wireguard/tasks/cron.yml index 9194648..3d723e5 100644 --- a/roles/wireguard/tasks/cron.yml +++ b/roles/wireguard/tasks/cron.yml @@ -3,5 +3,5 @@ - name: add cronjob for keepalive ansible.builtin.cron: name: keepalive network traffic to domain controller - user: nobody - job: ping -c 1 {{ hostvars[wireguard__domain_controller].__ip.external }} + user: root + job: "! ping -c 1 -w 1 {{ hostvars[wireguard__domain_controller].__ip.external }} && wg-quick down {{ wireguard__interface_name }} && wg-quick up {{ wireguard__interface_name }}" -- cgit v1.2.3