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:
2025-11-05 22:36:19 +01:00
parent bfdd2d07b3
commit bb99d469fe

View File

@@ -3,7 +3,7 @@
ansible.builtin.set_fact:
krb5_conf_path: >-
{{ (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
| first # safely take the first match
) | default('', true) }}