From 0ed98936875002073a4ea227ac5029ca6706f574 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Thu, 5 Oct 2023 11:07:31 +0300 Subject: [PATCH] fix hosts config --- tasks/configure.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index 922d83d..8e55191 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -64,8 +64,8 @@ - name: Configure peers hosts file entry lineinfile: path: /etc/hosts - regexp: "^{{ item['AllowedIPs'] | regex_replace('/.*$', '')}} " - line: "{{ item['AllowedIPs'] | regex_replace('/.*$', '')}} {{ item['name'] }}.{{ vpn_domain }}" + regexp: "^{{ hostvars[item]['AllowedIPs'] | regex_replace('/.*$', '')}} " + line: "{{ hostvars[item]['AllowedIPs'] | regex_replace('/.*$', '')}} {{ item }}.{{ vpn_domain }}" backup: true create: true loop: "{{ groups['wireguard_clients'] }}"