Add laptop wireguard configuration
This commit is contained in:
parent
c3cb8e1e8f
commit
b914c1bdcf
18 changed files with 113 additions and 519 deletions
24
templates/laptop/network/wg0.netdev.j2
Normal file
24
templates/laptop/network/wg0.netdev.j2
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
|
||||
[NetDev]
|
||||
Name={{ vpn_interface }}
|
||||
Kind=wireguard
|
||||
Description=WireGuard tunnel {{ vpn_interface }}
|
||||
|
||||
[WireGuard]
|
||||
# PrivateKeyFile option does not seem to work, perhaps a bug?
|
||||
PrivateKey={{ vpn_private_key }}
|
||||
|
||||
{% for peer in vpn_peers %}
|
||||
[WireGuardPeer]
|
||||
PublicKey={{ peer.public_key }}
|
||||
# PresharedKeyFile option does not seem to work, perhaps a bug?
|
||||
PresharedKey={{ peer.preshared_key }}
|
||||
AllowedIPs={{ peer.allowd_ips }}
|
||||
{% if peer.endpoint %}
|
||||
Endpoint={{ peer.endpoint }}
|
||||
{% endif %}
|
||||
{% if not loop.last %}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue