Group/host variable refactor

This commit is contained in:
Sonny Bakker 2025-03-15 00:05:30 +01:00
parent eb308670cc
commit 4b8aaf3e95
78 changed files with 445 additions and 374 deletions

View 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 %}