Shell best practice (#40)

* add shell options to syncconf handler to fail fast in case of error

* update CHANGELOG
unmanaged-hosts 6.0.1
Robert Wimmer 5 years ago committed by GitHub
parent 8e7ed9e702
commit 3322faf576
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,10 @@
Changelog Changelog
--------- ---------
**6.0.1**
- add shell options to syncconf handler to fail fast in case of error
**6.0.0** **6.0.0**
- Newer versions of WireGuard (around November 2019) introduced `wg syncconf` subcommand. This has the advantage that changes to the WireGuard configuration can be applied without disturbing existing connections. With this change this role tries to use `wg syncconf` subcommand when available. This even works if you have hosts with older and newer WireGuard versions. - Newer versions of WireGuard (around November 2019) introduced `wg syncconf` subcommand. This has the advantage that changes to the WireGuard configuration can be applied without disturbing existing connections. With this change this role tries to use `wg syncconf` subcommand when available. This even works if you have hosts with older and newer WireGuard versions.

@ -8,6 +8,9 @@
- name: syncconf wireguard - name: syncconf wireguard
shell: | shell: |
set -o errexit
set -o pipefail
set -o nounset
systemctl is-active wg-quick@wg-quick@{{ wireguard_interface|quote }} || systemctl start wg-quick@{{ wireguard_interface|quote }} systemctl is-active wg-quick@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) wg syncconf {{ wireguard_interface|quote }} <(wg-quick strip /etc/wireguard/{{ wireguard_interface|quote }}.conf)
exit 0 exit 0

Loading…
Cancel
Save