Bug 2114981
Summary: | Can't run SCAP playbooks on RHEL 8.6 with ansible-core | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Marek Haicman <mhaicman> |
Component: | scap-security-guide | Assignee: | Vojtech Polasek <vpolasek> |
Status: | CLOSED MIGRATED | QA Contact: | BaseOS QE Security Team <qe-baseos-security> |
Severity: | high | Docs Contact: | Jan Fiala <jafiala> |
Priority: | unspecified | ||
Version: | --- | CC: | afarley, bblasco, briasmit, ggasparb, jafiala, maburgha, mgoyal, mhaicman, mlysonek, myllynen, openscap-maint, qe-baseos-security, rmeggins, skonish, sthirugn, vpolasek, wsato |
Target Milestone: | rc | Keywords: | MigratedToJIRA, Triaged |
Target Release: | --- | Flags: | pm-rhel:
mirror+
|
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Known Issue | |
Doc Text: |
.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`.
====
|
Story Points: | --- |
Clone Of: | 2105162 | Environment: | |
Last Closed: | 2023-08-30 08:20:21 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 2105162 | ||
Bug Blocks: |
Comment 4
skonish
2023-01-23 15:11:46 UTC
// Same command, but -vvv included in the ansible-playbook command: TASK [Unit Socket Exists - autofs.socket] ************************************** task path: /home/rhuser/rhel8-playbook-cis_server_l1.yml:7489 <localhost> ESTABLISH LOCAL CONNECTION FOR USER: root <localhost> EXEC /bin/sh -c 'echo ~root && sleep 0' <localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1674527390.9242747-8968-142812848796448 `" && echo ansible-tmp-1674527390.9242747-8968-142812848796448="` echo /root/.ansible/tmp/ansible-tmp-1674527390.9242747-8968-142812848796448 `" ) && sleep 0' Using module file /usr/lib/python3.9/site-packages/ansible/modules/command.py <localhost> PUT /root/.ansible/tmp/ansible-local-3010l7z7b9g9/tmppb4dpl9t TO /root/.ansible/tmp/ansible-tmp-1674527390.9242747-8968-142812848796448/AnsiballZ_command.py <localhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1674527390.9242747-8968-142812848796448/ /root/.ansible/tmp/ansible-tmp-1674527390.9242747-8968-142812848796448/AnsiballZ_command.py && sleep 0' <localhost> EXEC /bin/sh -c '/usr/libexec/platform-python /root/.ansible/tmp/ansible-tmp-1674527390.9242747-8968-142812848796448/AnsiballZ_command.py && sleep 0' <localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1674527390.9242747-8968-142812848796448/ > /dev/null 2>&1 && sleep 0' fatal: [localhost]: FAILED! => { "changed": false, "invocation": { "module_args": { "_raw_params": "systemctl list-unit-files autofs.socket", "_uses_shell": false, "argv": null, "chdir": null, "creates": null, "executable": null, "removes": null, "stdin": null, "stdin_add_newline": true, "strip_empty_ends": true, "warn": false } }, "msg": "Unsupported parameters for (ansible.legacy.command) module: warn. Supported parameters include: stdin, executable, _uses_shell, stdin_add_newline, _raw_params, strip_empty_ends, chdir, creates, removes, argv." } ...ignoring TASK [Disable socket autofs] *************************************************** task path: /home/rhuser/rhel8-playbook-cis_server_l1.yml:7513 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 '/home/rhuser/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 // I ran tis command at the end to see what the output might look like w/out Ansible: # systemctl list-unit-files autofs.socket 0 unit files listed. @skonish What is the output of "dnf list ansible-core" and "ansible --version"? 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! 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. 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. |