style 💎: Improve regex pattern for krb5_conf_path variable
Updated the regex pattern to correctly extract the krb5.conf path from the Samba provision output. This change ensures that the variable returns a list of paths even if only one is present.
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
krb5_conf_path: >-
|
||||
{{ (your_string_variable
|
||||
| regex_search(r"(/\S*krb5\.conf)", "\\1")
|
||||
| default([]) # ensures a list even if no match
|
||||
| first # safely take the first match
|
||||
| default([])
|
||||
| first
|
||||
) | default('', true) }}
|
||||
when: samba_provision_output.stdout is defined
|
||||
|
||||
|
||||
Reference in New Issue
Block a user