Updated the regular expression to extract the absolute path of the krb5.conf file from the provision output, ensuring consistency and accuracy in the extracted value.
18 lines
580 B
YAML
18 lines
580 B
YAML
---
|
|
- name: Extract any 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) }}
|
|
when: samba_provision_output.stdout is defined
|
|
|
|
- name: Copy krb5.conf to /etc/krb5.conf
|
|
ansible.builtin.copy:
|
|
src: '{{ krb5_conf_path }}'
|
|
dest: /etc/krb5.conf
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
# Only run this if the provision was successful (changed)
|
|
when: samba_provision_output.changed |