Fix regexp for wireguard-IP-detection.

This commit is contained in:
Raphael Dannecker 2024-06-23 10:57:24 +02:00
parent 4863caf526
commit bb3acdba6d

View file

@ -30,7 +30,7 @@
- name: Set facts wg_ip
ansible.builtin.set_fact:
wg_ip: "{{ wg_serverconfig.stdout | regex_search('AllowedIPs = (0-9.)+/32', '\\1') }}"
wg_ip: "{{ wg_serverconfig.stdout | regex_search('AllowedIPs = ([0-9.]+)/32', '\\1', multiline=True) | first }}"
when: wg_serverconfig.rc == 0 and wg_ip is not defined
- name: Check if Wireguard exists on client