From e5bf8cda1768524454350da45f09d45616df0af1 Mon Sep 17 00:00:00 2001 From: githubixx Date: Tue, 5 Nov 2019 22:08:32 +0100 Subject: [PATCH] add host comments to WG config file --- templates/wg.conf.j2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/wg.conf.j2 b/templates/wg.conf.j2 index 11e7156..eb74425 100644 --- a/templates/wg.conf.j2 +++ b/templates/wg.conf.j2 @@ -1,5 +1,6 @@ #jinja2: lstrip_blocks:"True",trim_blocks:"True" [Interface] +# {{ inventory_hostname }} Address = {{hostvars[inventory_hostname].wireguard_address}} PrivateKey = {{private_key}} ListenPort = {{wireguard_port}} @@ -34,6 +35,7 @@ SaveConfig = true {% if host != inventory_hostname %} [Peer] + # {{ host }} PublicKey = {{hostvars[host].public_key}} {% if hostvars[host].wireguard_allowed_ips is defined %} AllowedIPs = {{hostvars[host].wireguard_allowed_ips}} @@ -52,7 +54,7 @@ SaveConfig = true {% elif hostvars[host].wireguard_endpoint is defined and hostvars[host].wireguard_endpoint != "" %} Endpoint = {{hostvars[host].wireguard_endpoint}}:{{wireguard_port}} {% elif hostvars[host].wireguard_endpoint == "" %} - # No endpoint defined + # No endpoint defined for this peer {% else %} Endpoint = {{host}}:{{wireguard_port}} {% endif %}