feat: full untested ansible setup
This commit is contained in:
21
roles/wireguard/templates/wg0.conf.j2
Normal file
21
roles/wireguard/templates/wg0.conf.j2
Normal file
@@ -0,0 +1,21 @@
|
||||
[Interface]
|
||||
Address = {{ wireguard_interface.address | join(', ') }}
|
||||
ListenPort = {{ wireguard_interface.listen_port }}
|
||||
PrivateKey = {{ wireguard_interface.private_key }}
|
||||
|
||||
{% for peer in wireguard_interface.peers %}
|
||||
# {{ peer.name }}
|
||||
[Peer]
|
||||
PublicKey = {{ peer.public_key }}
|
||||
{% if peer.preshared_key is defined and peer.preshared_key | length > 0 %}
|
||||
PresharedKey = {{ peer.preshared_key }}
|
||||
{% endif %}
|
||||
AllowedIPs = {{ peer.allowed_ips | join(', ') }}
|
||||
{% if peer.endpoint is defined %}
|
||||
Endpoint = {{ peer.endpoint }}
|
||||
{% endif %}
|
||||
{% if peer.persistent_keepalive is defined %}
|
||||
PersistentKeepalive = {{ peer.persistent_keepalive }}
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
Reference in New Issue
Block a user