ansible
This commit is contained in:
parent
7974e36c1b
commit
b81f7e15b2
41 changed files with 1632 additions and 0 deletions
21
ansible/roles/wireguard/templates/client.conf.j2
Normal file
21
ansible/roles/wireguard/templates/client.conf.j2
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# WireGuard Client Configuration - {{ item.name }}
|
||||
# Generated by Ansible on {{ ansible_date_time.iso8601 }}
|
||||
# Server: {{ inventory_hostname }}
|
||||
|
||||
[Interface]
|
||||
PrivateKey = {{ item.private_key }}
|
||||
Address = {{ item.ipv4 }}/32,{{ item.ipv6 }}/128
|
||||
{% if wireguard_dns_servers | length > 0 %}
|
||||
DNS = {{ wireguard_dns_servers | join(', ') }}
|
||||
{% endif %}
|
||||
|
||||
[Peer]
|
||||
PublicKey = {{ wireguard_server_public_key }}
|
||||
{% if item.preshared_key %}
|
||||
PresharedKey = {{ item.preshared_key }}
|
||||
{% endif %}
|
||||
Endpoint = {{ ansible_host }}:{{ wireguard_port }}
|
||||
# Allow all VPN traffic (peer-to-peer connectivity)
|
||||
AllowedIPs = {{ wireguard_ipv4_network }},{{ wireguard_ipv6_network }}{% if wireguard_additional_routes | length > 0 %},{{ wireguard_additional_routes | join(',') }}{% endif %}
|
||||
|
||||
PersistentKeepalive = {{ item.persistent_keepalive | default(25) }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue