Generate simple config
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
708147f415
commit
dead47287a
5 changed files with 54 additions and 33 deletions
|
|
@ -46,10 +46,16 @@ SaveConfig = {{ wireguard_save_config }}
|
|||
|
||||
[Peer]
|
||||
# {{ host }}
|
||||
PublicKey = {{ public_key_files.results[0].stdout }}
|
||||
PublicKey = {{ hostvars[host].wireguard_public_key }}
|
||||
#AllowedIPs = 0.0.0.0/0,::/0
|
||||
AllowedIPs = {{ wireguard_address }}
|
||||
Endpoint = {{ ansible_default_ipv4.address }}:{{ vpn_port }}
|
||||
PersistentKeepalive = 20
|
||||
{% if hostvars[host].wireguard_allowed_ips is defined %}
|
||||
AllowedIPs = {{hostvars[host].wireguard_allowed_ips}}
|
||||
{% else %}
|
||||
AllowedIPs = {{ hostvars[host].wireguard_address.split('/')[0] }}/32
|
||||
{% endif %}
|
||||
Endpoint = {{ hostvars[host].ansible_default_ipv4.address }}:{{ wireguard_port }}
|
||||
{% if hostvars[host].wireguard_persistent_keepalive is defined %}
|
||||
PersistentKeepalive = {{hostvars[host].wireguard_persistent_keepalive}}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue