From 9cad7d3b646d6d2fed654a164d49c47809311d61 Mon Sep 17 00:00:00 2001 From: Jose Date: Wed, 5 Nov 2025 21:37:57 +0100 Subject: [PATCH] =?UTF-8?q?style=20=F0=9F=92=8E:=20Update=20regex=20search?= =?UTF-8?q?=20for=20krb5=5Fconf=5Fpath?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated the regex search pattern in the `krb5_conf_path` fact to ensure a list is returned even if no match is found, and added default values for clarity. --- tasks/kerberos.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasks/kerberos.yml b/tasks/kerberos.yml index 66a5c1f..5064b6c 100644 --- a/tasks/kerberos.yml +++ b/tasks/kerberos.yml @@ -1,10 +1,12 @@ --- -- name: Extract any absolute krb5.conf path from provision output +- name: Extract absolute krb5.conf path from provision output ansible.builtin.set_fact: krb5_conf_path: >- {{ (samba_provision_output.stdout | regex_search('(/[^\\s]+/krb5\\.conf)', '\\1') - | first) | default('', true) }} + | default([]) # ensures a list even if no match + | first # safely takes the first match + ) | default('', true) }} when: samba_provision_output.stdout is defined - name: Copy krb5.conf to /etc/krb5.conf