improved logic for files that change state

Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
Mark Bolwell 2024-08-20 16:51:53 +01:00
parent 6128104385
commit 11c980ec5f
No known key found for this signature in database
GPG key ID: 997FF7FE93AEB5B9

View file

@ -68,6 +68,8 @@
ansible.builtin.file:
path: "{{ item.path }}"
owner: root
failed_when: rhel9cis_6_3_4_6_file_list.state not in '[ file, absent ]'
register: rhel9cis_6_3_4_6_file_list
loop: "{{ prelim_auditd_conf_files.files | default([]) }}"
loop_control:
label: "{{ item.path }}"
@ -84,6 +86,8 @@
ansible.builtin.file:
path: "{{ item.path }}"
group: root
failed_when: rhel9cis_6_3_4_7_file_list.state not in '[ file, absent ]'
register: rhel9cis_6_3_4_7_file_list
loop: "{{ prelim_auditd_conf_files.files | default([]) }}"
loop_control:
label: "{{ item.path }}"