This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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.
Bug 2114981 - Can't run SCAP playbooks on RHEL 8.6 with ansible-core
Summary: Can't run SCAP playbooks on RHEL 8.6 with ansible-core
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: scap-security-guide
Version: ---
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Vojtech Polasek
QA Contact: BaseOS QE Security Team
Jan Fiala
URL:
Whiteboard:
Depends On: 2105162
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-03 16:03 UTC by Marek Haicman
Modified: 2023-08-30 08:20 UTC (History)
17 users (show)

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`. ====
Clone Of: 2105162
Environment:
Last Closed: 2023-08-30 08:20:21 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-1799 0 None Migrated None 2023-08-30 08:20:18 UTC
Red Hat Issue Tracker RHELPLAN-130219 0 None None None 2022-08-03 16:18:46 UTC

Comment 4 skonish 2023-01-23 15:11:46 UTC
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

Comment 6 skonish 2023-01-24 03:38:52 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.

Comment 7 Brian Smith 2023-01-24 13:41:09 UTC
@skonish What is the output of "dnf list ansible-core" and "ansible --version"?

Comment 8 skonish 2023-01-24 19:27:31 UTC
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 10 RHEL 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 11 RHEL 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.


Note You need to log in before you can comment on or make changes to this bug.