style 💎: Update regex pattern for extracting krb5.conf path
Updated the regular expression to correctly extract the krb5.conf path from the provision output, ensuring consistency in variable assignment.
This commit is contained in:
@@ -2,10 +2,10 @@
|
|||||||
- name: Extract absolute krb5.conf path from provision output
|
- name: Extract absolute krb5.conf path from provision output
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
krb5_conf_path: >-
|
krb5_conf_path: >-
|
||||||
{{ (samba_provision_output.stdout
|
{{ (your_string_variable
|
||||||
| regex_search('(/[^\\s]+/krb5\\.conf)', '\\1')
|
| regex_search(r'(/\S*krb5\.conf)', '\\1')
|
||||||
| default([]) # ensures a list even if no match
|
| default([]) # ensures a list even if no match
|
||||||
| first # safely takes the first match
|
| first # safely take the first match
|
||||||
) | default('', true) }}
|
) | default('', true) }}
|
||||||
when: samba_provision_output.stdout is defined
|
when: samba_provision_output.stdout is defined
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user