From b5b3d9384f34c1817beb22fae93d38e529b5a08d Mon Sep 17 00:00:00 2001 From: Jose Date: Thu, 6 Nov 2025 06:07:39 +0100 Subject: [PATCH] =?UTF-8?q?style=20=F0=9F=92=8E:=20Improve=20regex=20patte?= =?UTF-8?q?rn=20for=20extracting=20krb5=20conf=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated the regular expression to correctly extract the absolute path of the krb5.conf file from the samba provision output. This change ensures that the extracted path is properly formatted and can be used in subsequent tasks. --- tasks/kerberos.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tasks/kerberos.yml b/tasks/kerberos.yml index 235e331..5df7d03 100644 --- a/tasks/kerberos.yml +++ b/tasks/kerberos.yml @@ -2,10 +2,13 @@ - name: Extract absolute krb5.conf path from provision output ansible.builtin.set_fact: krb5_conf_path: >- - {{ (samba_provision_output.stdout - | regex_findall("(/[^\\s]+/krb5\\.conf)") + {{ ( + samba_provision_output.stdout + | regex_findall("(/[^\\s,'\"]+krb5\\.conf)") | default([]) - ) | first | default('') }} + | first + | default('') + ) | replace(\"'\", '') | replace('\"', '') | replace(',', '') | trim }} when: samba_provision_output.stdout is defined - name: print krb5.conf path