Skip to content

Commit

Permalink
Prefix host name comment with 'Name =' for wg-info (#153)
Browse files Browse the repository at this point in the history
* Prefix host name comment with 'Name =' for wg-info

* Ditto for unmanaged peers
  • Loading branch information
tarag authored Nov 20, 2023
1 parent 79e8cec commit 731f956
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/etc/wireguard/wg.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ SaveConfig = {{ wireguard_save_config }}
{% if host != inventory_hostname %}

[Peer]
# {{ host }}
# Name = {{ host }}
PublicKey = {{hostvars[host].wireguard__fact_public_key}}
{% if hostvars[host].wireguard_allowed_ips is defined %}
AllowedIPs = {{hostvars[host].wireguard_allowed_ips}}
Expand Down Expand Up @@ -105,7 +105,7 @@ Endpoint = {{host}}:{{wireguard_port}}
# Peers not managed by Ansible from "wireguard_unmanaged_peers" variable
{% for peer in wireguard_unmanaged_peers.keys() %}
[Peer]
# {{ peer }}
# Name = {{ peer }}
PublicKey = {{ wireguard_unmanaged_peers[peer].public_key }}
{% if wireguard_unmanaged_peers[peer].preshared_key is defined %}
PresharedKey = {{ wireguard_unmanaged_peers[peer].preshared_key }}
Expand Down

0 comments on commit 731f956

Please sign in to comment.