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

This commit is contained in:
Adrien Reslinger 2022-07-30 12:35:42 +02:00
parent ee12fbfcc8
commit 78f202b11f
Signed by: adrien
GPG key ID: DA7B27055C66D6DE
2 changed files with 8 additions and 0 deletions

View file

@ -13,5 +13,7 @@ wireguard_port: 51820
# wireguard_postdown:
wireguard_persistent_keepalive: 20
wireguard_save_config: true
# wireguard_endpoint_port: "51820"
# wireguard_endpoint_ip: "x.x.x.x"
skip_conf: false

View file

@ -53,7 +53,13 @@ AllowedIPs = {{hostvars[host].wireguard_allowed_ips}}
{% else %}
AllowedIPs = {{ hostvars[host].wireguard_address.split('/')[0] }}/32
{% endif %}
{% if hostvars[host].wireguard_endpoint_ip is defined and hostvars[host].wireguard_endpoint_port is defined %}
Endpoint = {{ hostvars[host].wireguard_endpoint_ip }}:{{ hostvars[host].wireguard_endpoint_port }}
{% elif hostvars[host].wireguard_endpoint_ip is defined %}
Endpoint = {{ hostvars[host].wireguard_endpoint_ip }}:{{ hostvars[host].wireguard_port }}
{% else %}
Endpoint = {{ hostvars[host].ansible_default_ipv4.address }}:{{ wireguard_port }}
{% endif %}
{% if hostvars[host].wireguard_persistent_keepalive is defined %}
PersistentKeepalive = {{hostvars[host].wireguard_persistent_keepalive}}
{% endif %}