diff --git a/tasks/kerberos.yml b/tasks/kerberos.yml index 57f6f90..2d6f3b2 100644 --- a/tasks/kerberos.yml +++ b/tasks/kerberos.yml @@ -2,10 +2,10 @@ - name: Extract absolute krb5.conf path from provision output ansible.builtin.set_fact: krb5_conf_path: >- - {{ (samba_provision_output.stdout - | regex_search('(/[^\\s]+/krb5\\.conf)', '\\1') + {{ (your_string_variable + | regex_search(r'(/\S*krb5\.conf)', '\\1') | default([]) # ensures a list even if no match - | first # safely takes the first match + | first # safely take the first match ) | default('', true) }} when: samba_provision_output.stdout is defined