Use shell for grep with shell expansions

Signed-off-by: Christopher Papke <chris.papke@thalesgroup.com>
This commit is contained in:
Christopher Papke 2025-01-07 12:57:02 -08:00
parent f057484a7a
commit 88a497b195
No known key found for this signature in database
GPG key ID: F0E2AE3AE922E9CF

View file

@ -141,7 +141,7 @@
- rule_5.3.2.5
block:
- name: "5.3.2.5 | AUDIT | Ensure pam_unix module is enabled"
ansible.builtin.command: grep -P -- '\b(pam_unix\.so)\b' /etc/authselect/"$(head -1 /etc/authselect/authselect.conf)"/{system,password}-auth
ansible.builtin.shell: grep -P -- '\b(pam_unix\.so)\b' /etc/authselect/"$(head -1 /etc/authselect/authselect.conf)"/{system,password}-auth
changed_when: false
failed_when: discovered_discovered_authselect_pam_unix.rc not in [ 0, 1 ]
register: discovered_discovered_authselect_pam_unix