diff --git a/templates/wg.conf.j2 b/templates/wg.conf.j2 index 81e0d48..3d381bb 100644 --- a/templates/wg.conf.j2 +++ b/templates/wg.conf.j2 @@ -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}}