diff --git a/tasks/kerberos.yml b/tasks/kerberos.yml index 5df7d03..09feaa4 100644 --- a/tasks/kerberos.yml +++ b/tasks/kerberos.yml @@ -2,13 +2,18 @@ - 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)") + | regex_findall('(/[^\\s,"\']*krb5\\.conf)') + | map('regex_replace', "['\",]", '') # remove quotes and commas from matches + | list | default([]) - | first - | default('') - ) | replace(\"'\", '') | replace('\"', '') | replace(',', '') | trim }} + ) + | first + | default('') + | trim + }} when: samba_provision_output.stdout is defined - name: print krb5.conf path