style 💎: Improve regex pattern for finding krb5.conf path
Updated the regex pattern to correctly extract the krb5.conf path from the `your_string_variable` value, ensuring a more reliable and consistent configuration setup.
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
krb5_conf_path: >-
|
krb5_conf_path: >-
|
||||||
{{ (your_string_variable
|
{{ (your_string_variable
|
||||||
| regex_search(r'(/\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 take the first match
|
| first # safely take the first match
|
||||||
) | default('', true) }}
|
) | default('', true) }}
|
||||||
|
|||||||
Reference in New Issue
Block a user