diff --git a/tasks/configure.yml b/tasks/configure.yml index f8a3e3b..55ae9a7 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -76,7 +76,7 @@ lineinfile: path: /etc/hosts regexp: "^{{ hostvars[item]['AllowedIPs'] | regex_replace('/.*$', '')}} " - line: "{{ hostvars[item]['AllowedIPs'] | regex_replace('/.*$', '')}} {{ item }}.{{ vpn_domain }}" + line: "{{ hostvars[item]['AllowedIPs'] | default('') | regex_replace('/.*$', '')}} {{ item }}.{{ vpn_domain }}" backup: true create: true loop: "{{ groups['wireguard_clients'] }}"