Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
.Ansible remediations require additional collections
With the replacement of Ansible Engine by the `ansible-core` package, the list of Ansible modules provided with the RHEL subscription is reduced. As a consequence, running remediations that use Ansible content included within the `scap-security-guide` package requires collections from the `rhc-worker-playbook` package.
For an Ansible remediation, perform the following steps:
. Install the required packages:
+
----
# dnf install -y ansible-core scap-security-guide rhc-worker-playbook
----
. Navigate to the `/usr/share/scap-security-guide/ansible` directory:
+
----
# cd /usr/share/scap-security-guide/ansible
----
. Run the relevant Ansible playbook using environment variables that define the path to the additional Ansible collections:
+
[subs="+quotes",options="nowrap",role="white-space-pre"]
----
# ANSIBLE_COLLECTIONS_PATH=/usr/share/rhc-worker-playbook/ansible/collections/ansible_collections/ ansible-playbook -c local -i localhost, rhel9-playbook-_cis_server_l1_.yml
----
+
Replace `_cis_server_l1_` with the ID of the profile against which you want to remediate the system.
As a result, the Ansible content is processed correctly.
[NOTE]
====
Support of the collections provided in `rhc-worker-playbook` is limited to enabling the Ansible content sourced in `scap-security-guide`.
====
It seems as though
// using RHEL 8.7 Server in a VM.
# dnf install -y ansible-core scap-security-guide rhc-worker-playbook
# cd /usr/share/scap-security-guide/ansible
# ANSIBLE_COLLECTIONS_PATH=/usr/share/rhc-worker-playbook/ansible/collections/ansible_collections/ ansible-playbook -c local -i localhost, rhel8-playbook-cis_server_l1.yml
// it seems to mostly work except for the "autofs" stage at the end:
TASK [Unit Socket Exists - autofs.socket] ***************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (ansible.legacy.command) module: warn. Supported parameters include: _raw_params, _uses_shell, executable, strip_empty_ends, removes, stdin_add_newline, chdir, stdin, argv, creates."}
...ignoring
TASK [Disable socket autofs] ****************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "The conditional check '\"autofs.socket\" in socket_file_exists.stdout_lines[1]' failed. The error was: error while evaluating conditional (\"autofs.socket\" in socket_file_exists.stdout_lines[1]): 'dict object' has no attribute 'stdout_lines'. 'dict object' has no attribute 'stdout_lines'\n\nThe error appears to be in '/usr/share/scap-security-guide/ansible/rhel8-playbook-cis_server_l1.yml': line 7513, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Disable socket autofs\n ^ here\n"}
PLAY RECAP **********************************************************************************************************************************************************
localhost : ok=338 changed=59 unreachable=0 failed=1 skipped=132 rescued=0 ignored=1
Please disregard my earlier comments.
The VM I was using had ansible-engine installed, then I removed it, and added ansible-core instead.
That seemed to impact the playbook execution.
I've installed a fresh VM, and only installed ansible-core, and it runs fine now.
Thanks!
Comment 10RHEL Program Management
2023-08-30 08:18:37 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.
Comment 11RHEL Program Management
2023-08-30 08:20:21 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.
To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer. You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:
"Bugzilla Bug" = 1234567
In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues.
It seems as though // using RHEL 8.7 Server in a VM. # dnf install -y ansible-core scap-security-guide rhc-worker-playbook # cd /usr/share/scap-security-guide/ansible # ANSIBLE_COLLECTIONS_PATH=/usr/share/rhc-worker-playbook/ansible/collections/ansible_collections/ ansible-playbook -c local -i localhost, rhel8-playbook-cis_server_l1.yml // it seems to mostly work except for the "autofs" stage at the end: TASK [Unit Socket Exists - autofs.socket] *************************************************************************************************************************** fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (ansible.legacy.command) module: warn. Supported parameters include: _raw_params, _uses_shell, executable, strip_empty_ends, removes, stdin_add_newline, chdir, stdin, argv, creates."} ...ignoring TASK [Disable socket autofs] **************************************************************************************************************************************** fatal: [localhost]: FAILED! => {"msg": "The conditional check '\"autofs.socket\" in socket_file_exists.stdout_lines[1]' failed. The error was: error while evaluating conditional (\"autofs.socket\" in socket_file_exists.stdout_lines[1]): 'dict object' has no attribute 'stdout_lines'. 'dict object' has no attribute 'stdout_lines'\n\nThe error appears to be in '/usr/share/scap-security-guide/ansible/rhel8-playbook-cis_server_l1.yml': line 7513, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Disable socket autofs\n ^ here\n"} PLAY RECAP ********************************************************************************************************************************************************** localhost : ok=338 changed=59 unreachable=0 failed=1 skipped=132 rescued=0 ignored=1