diff --git a/tasks/kerberos.yml b/tasks/kerberos.yml index 7046cd6..a36725c 100644 --- a/tasks/kerberos.yml +++ b/tasks/kerberos.yml @@ -1,9 +1,10 @@ --- -- name: Extract krb5.conf path from provision output - # The samba-tool output usually contains the path on a specific line. - # We extract the path using regex and the 'search' filter. +- name: Extract krb5.conf path from provision output (robust) ansible.builtin.set_fact: - krb5_conf_path: "{{ samba_provision_output.stdout | regex_search('krb5.conf file is located at (.*)', '\\1') | first }}" + krb5_conf_path: >- + {{ (samba_provision_output.stdout + | regex_search('generated at ([^\n]+/krb5\\.conf)', '\\1') + | first) | default('', true) }} when: samba_provision_output.stdout is defined - name: Copy krb5.conf to /etc/krb5.conf