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 }}"