ansible-role-wireguard_client/templates/wireguard_client.conf
2023-10-05 10:42:02 +03:00

14 lines
598 B
Text

[Interface]
Address = {{ wg_address | default(AllowedIPs) }}
PrivateKey = {{ private_key }}
ListenPort = {{ listenport }}
{% if vpn_dns is defined %}DNS = {{ vpn_dns }}{% endif %}
{% for item in groups['wireguard_clients'] %}{% if item['name'] != inventory_hostname and 'PublicKey' in item and 'AllowedIPs' in item %}
# Peer name: {{ item.name }}
[Peer]
PublicKey = {{ item.PublicKey }}
AllowedIPs = {{ item.AllowedIPs }}
{% if item.EndPointIP is defined and item.EndPointIP != '' %}EndPoint = {{ item.EndPointIP }}:{{ item.listenport | default(listenport) }}
{% endif %}{% endif %}{% endfor %}