From 7a3888e6c7ed7e6c9419359986fcee8457ec928e Mon Sep 17 00:00:00 2001 From: Ahmed AbdelHalim Date: Sun, 14 Sep 2025 02:15:02 +0200 Subject: Fix wireguard stopping vpn when it's not necessary It's only necessary to stop the VPN to set another one running instead (as the configurations are not built to stack VPN although possible) --- roles/wireguard/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/wireguard/tasks/main.yml b/roles/wireguard/tasks/main.yml index 27a2f864..a0f0cca1 100644 --- a/roles/wireguard/tasks/main.yml +++ b/roles/wireguard/tasks/main.yml @@ -24,6 +24,7 @@ - name: "Configure autostart connection" become: true + when: wireguard_autostart_connection != "" block: - name: "Ensure all wireguard connections are stopped" ansible.builtin.systemd_service: @@ -44,4 +45,3 @@ name: "wg-quick@{{ wireguard_autostart_connection }}" enabled: true state: "started" - when: wireguard_autostart_connection != "" -- cgit v1.2.3