From 57340b6c0653b70549335a9d077a35e85c28e20d Mon Sep 17 00:00:00 2001 From: Robert Wimmer <2039811+githubixx@users.noreply.github.com> Date: Sun, 6 Jun 2021 22:18:17 +0200 Subject: [PATCH] Update readme chlog formatting (#108) * handlers/main.yml: better formatting * update README/CHANGELOG --- CHANGELOG.md | 4 ++++ README.md | 4 ++++ handlers/main.yml | 16 ++++++++-------- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16029aa..320d424 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ SPDX-License-Identifier: GPL-3.0-or-later Changelog --------- +**7.11.0** + +- Introduce new variables `wireguard_service_enabled` and `wireguard_service_state` (contribution by @tjend) + **7.10.0** - Support for Proxmox diff --git a/README.md b/README.md index 447ed95..2d56293 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,10 @@ wireguard_conf_group: "{{ 'root' if not ansible_os_family == 'Darwin' else 'whee # The default mode of the wg.conf file wireguard_conf_mode: 0600 + +# The default state of the wireguard service +wireguard_service_enabled: "yes" +wireguard_service_state: "started" ``` The following variable is mandatory and needs to be configured for every host in `host_vars/` e.g.: diff --git a/handlers/main.yml b/handlers/main.yml index 8cfe0a5..2e6b03c 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -7,8 +7,8 @@ name: "wg-quick@{{ wireguard_interface }}" state: "{{ item }}" loop: - - stopped - - started + - stopped + - started when: - not wg_syncconf - not ansible_os_family == 'Darwin' @@ -17,12 +17,12 @@ - name: syncconf wireguard shell: | - set -o errexit - set -o pipefail - set -o nounset - systemctl is-active wg-quick@{{ wireguard_interface|quote }} || systemctl start wg-quick@{{ wireguard_interface|quote }} - wg syncconf {{ wireguard_interface|quote }} <(wg-quick strip /etc/wireguard/{{ wireguard_interface|quote }}.conf) - exit 0 + set -o errexit + set -o pipefail + set -o nounset + systemctl is-active wg-quick@{{ wireguard_interface|quote }} || systemctl start wg-quick@{{ wireguard_interface|quote }} + wg syncconf {{ wireguard_interface|quote }} <(wg-quick strip /etc/wireguard/{{ wireguard_interface|quote }}.conf) + exit 0 args: executable: "/bin/bash" when: