Add media vpn setup
This commit is contained in:
parent
79d0e64eb2
commit
34b89bddff
39 changed files with 386 additions and 97 deletions
20
templates/network/wireguard/default/wg0.netdev.j2
Normal file
20
templates/network/wireguard/default/wg0.netdev.j2
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
[NetDev]
|
||||
Name={{ vpn_interface }}
|
||||
Kind=wireguard
|
||||
Description=WireGuard tunnel wg0
|
||||
|
||||
[WireGuard]
|
||||
ListenPort={{ vpn_port }}
|
||||
PrivateKey={{ vpn_server_key }}
|
||||
|
||||
{% for peer, properties in vpn_peers.items() %}
|
||||
[WireGuardPeer]
|
||||
PublicKey={{ properties.public_key }}
|
||||
PresharedKey={{ properties.preshared_key }}
|
||||
AllowedIPs={{ properties.ip }}/32
|
||||
{% if not loop.last %}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue