initial commit

This commit is contained in:
Vi Truchseß
2023-02-08 15:04:36 +01:00
commit bc06adc15a
5 changed files with 138 additions and 0 deletions

18
wg_client.j2 Normal file
View File

@@ -0,0 +1,18 @@
{% set client = hostvars[item] %}
{% set servername = groups['wg_server'][0] %}
{% set server = hostvars[servername] %}
[Interface]
PrivateKey = {{ client.wg_key }}
{% if client.wg_ip4 | default(false) %}
Address = {{ client.wg_ip4 }}
{% endif %}
{% if client.wg_ip6 | default(false) %}
Address = {{ client.wg_ip6 }}
{% endif %}
DNS = {{ server.wg_dns }}
[Peer]
PublicKey = {{ server_pubkey.stdout }}
Endpoint = {{ server.wg_hostname }}:{{ server.wg_port }}
AllowedIPs = {{ server.wg_routes | join(',') }}
PersistentKeepalive = 25