style 💎: Improve regex pattern for extracting krb5 conf path
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user