Add check for empty pubkey
This commit is contained in:
parent
0dff9058ef
commit
a46b6fa428
1 changed files with 1 additions and 1 deletions
|
@ -5,7 +5,7 @@ ListenPort = {{ listenport }}
|
||||||
{% if vpn_dns is defined %}DNS = {{ vpn_dns }}{% endif %}
|
{% if vpn_dns is defined %}DNS = {{ vpn_dns }}{% endif %}
|
||||||
|
|
||||||
# From inventory
|
# From inventory
|
||||||
{% for item in groups['wireguard_clients'] %}{% if hostvars[item]['inventory_hostname'] != inventory_hostname and 'PublicKey' in hostvars[item] and 'AllowedIPs' in hostvars[item] %}
|
{% for item in groups['wireguard_clients'] %}{% if hostvars[item]['inventory_hostname'] != inventory_hostname and 'PublicKey' in hostvars[item] and 'AllowedIPs' in hostvars[item] and hostvars[item]['PublicKey'] != ""%}
|
||||||
# Peer name: {{ item }}
|
# Peer name: {{ item }}
|
||||||
[Peer]
|
[Peer]
|
||||||
PublicKey = {{ hostvars[item]['PublicKey'] }}
|
PublicKey = {{ hostvars[item]['PublicKey'] }}
|
||||||
|
|
Loading…
Reference in a new issue