1
0
Fork 0

use ansible_play_hosts instead of hardcoded vpn grp

should use the group in the play calling the role.
works fine when hosts bellong to several groups
This commit is contained in:
Frédéric Bourqui 2019-10-18 19:30:23 +02:00
parent 847dd3a903
commit 2583dd4264

View file

@ -16,7 +16,7 @@ PostDown = {{hostvars[inventory_hostname].wireguard_postdown}}
SaveConfig = true
{% endif %}
{% for host in groups["vpn"] %}
{% for host in ansible_play_hosts %}
{% if host != inventory_hostname %}
[Peer]
PublicKey = {{hostvars[host].public_key}}