diff --git a/templates/wg.conf.j2 b/templates/wg.conf.j2 index 1bcdfb5..69e93fa 100644 --- a/templates/wg.conf.j2 +++ b/templates/wg.conf.j2 @@ -5,7 +5,13 @@ {% for peer in wireguard_interfaces[item].peers %} [Peer] -{% for key, value in peer | dictsort %} -{{ key }} = {{ value }} -{% endfor %} +# {{ peer.name }} +PublicKey = {{ peer.PublicKey }} +AllowedIPs = {{ peer.AllowedIPs }} +{% if peer.Endpoint is defined %} +Endpoint = {{ peer.Endpoint }} +{% endif %} +{% if peer.PersistentKeepalive is defined %} +PersistentKeepalive = {{ peer.PersistentKeepalive }} +{% endif %} {% endfor %}