diff --git a/templates/wireguard_client.conf b/templates/wireguard_client.conf index eaa3784..00aa819 100644 --- a/templates/wireguard_client.conf +++ b/templates/wireguard_client.conf @@ -1,8 +1,8 @@ [Interface] -Address = {% for item in wireguard_peers %}{% if item['name'] == inventory_hostname %}{{ item['AllowedIPs'] }} -{% endif %}{% endfor %} +Address = {% for item in wireguard_peers %}{% if item['name'] == inventory_hostname %}{{ item['AllowedIPs'] }}{% endif %}{% endfor %} PrivateKey = {{ private_key }} ListenPort = {{ listenport }} +DNS = {% if vpn_dns is defined %}{{ vpn_dns }}{% else %}{{ server_address }}{% endif %} {% for item in wireguard_peers %}{% if item['name'] != inventory_hostname and 'PublicKey' in item and 'AllowedIPs' in item %}