From 20469486fe6c664d7bdc222c1c020566fc3ae839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Violet=20Truchse=C3=9F?= Date: Wed, 20 Nov 2024 19:14:20 +0100 Subject: [PATCH] added wg-quick restart and sudo --- wireguard.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wireguard.yml b/wireguard.yml index 56a2904..59d9414 100644 --- a/wireguard.yml +++ b/wireguard.yml @@ -1,5 +1,6 @@ - name: Setup Wireguard server hosts: wg_server + become: yes tasks: - name: Install wireguard apt: @@ -32,7 +33,10 @@ enabled: true handlers: - name: read wg config - shell: "wg syncconf {{ wg_interface }} <(wg-quick strip {{ wg_interface }})" + service: + name: "wg-quick@{{ wg_interface }}" + state: restarted + # shell: "wg syncconf {{ wg_interface }} <(wg-quick strip {{ wg_interface }})" # command: "wg setconf {{ wg_interface }} /etc/wireguard/{{ wg_interface }}.conf" # - name: reload interface # shell: "ifdown {{ wg_interface }}; ifup {{ wg_interface }}" @@ -51,4 +55,4 @@ template: src: wg_client.j2 dest: "wg_clients/wg_{{ item }}.conf" - with_items: "{{ groups['wg_clients'] | list }}" \ No newline at end of file + with_items: "{{ groups['wg_clients'] | list }}"