Update wireguard template
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Adrien Reslinger 2022-09-07 12:40:32 +02:00
parent 78f202b11f
commit 410b448e37
Signed by: adrien
GPG key ID: DA7B27055C66D6DE
2 changed files with 3 additions and 1 deletions

View file

@ -15,5 +15,6 @@ wireguard_persistent_keepalive: 20
wireguard_save_config: true
# wireguard_endpoint_port: "51820"
# wireguard_endpoint_ip: "x.x.x.x"
# wireguard_allowed_ips: []
skip_conf: false

View file

@ -49,7 +49,8 @@ SaveConfig = {{ wireguard_save_config }}
PublicKey = {{ hostvars[host].wireguard_public_key }}
#AllowedIPs = 0.0.0.0/0,::/0
{% if hostvars[host].wireguard_allowed_ips is defined %}
AllowedIPs = {{hostvars[host].wireguard_allowed_ips}}
AllowedIPs = {{ hostvars[host].wireguard_address.split('/')[0] }}/32, {% for wireguard_allowed_ip in hostvars[host].wireguard_allowed_ips %}{{ wireguard_allowed_ip }}{% if not loop.last %}, {% endif %}{% endfor %}
{% else %}
AllowedIPs = {{ hostvars[host].wireguard_address.split('/')[0] }}/32
{% endif %}