Group/host variable refactor
This commit is contained in:
parent
eb308670cc
commit
4b8aaf3e95
78 changed files with 445 additions and 374 deletions
24
templates/personal/desktop/network/wg0.netdev.j2
Normal file
24
templates/personal/desktop/network/wg0.netdev.j2
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
[NetDev]
|
||||
Name={{ vpn_default.interface }}
|
||||
Kind=wireguard
|
||||
Description=WireGuard tunnel {{ vpn_default.interface }}
|
||||
|
||||
[WireGuard]
|
||||
PrivateKeyFile={{ vpn_default.private_key_path }}
|
||||
|
||||
{% for peer in vpn_default.peers %}
|
||||
[WireGuardPeer]
|
||||
PublicKey={{ peer.public_key }}
|
||||
PresharedKeyFile={{ peer.preshared_key_path }}
|
||||
{% for ip in peer.allowed_ips %}
|
||||
AllowedIPs={{ ip.address }}
|
||||
{% endfor %}
|
||||
{% if peer.endpoint %}
|
||||
Endpoint={{ peer.endpoint }}
|
||||
{% endif %}
|
||||
{% if not loop.last %}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue