ensure_redhat_gpgkey_installed: use command module instead of rpm_key in Ansible remediation#14517
Merged
ggbecker merged 1 commit intoComplianceAsCode:masterfrom Mar 3, 2026
Conversation
…mand instead of rpmkey Ansible module The module is currently not working when encountering keys with PQC signatures Relevant issue: ansible/ansible#86157
|
This datastream diff is auto generated by the check Click here to see the full diffansible remediation for rule 'xccdf_org.ssgproject.content_rule_ensure_redhat_gpgkey_installed' differs.
--- xccdf_org.ssgproject.content_rule_ensure_redhat_gpgkey_installed
+++ xccdf_org.ssgproject.content_rule_ensure_redhat_gpgkey_installed
@@ -99,9 +99,7 @@
- restrict_strategy
- name: 'Ensure Red Hat GPG Key Installed: Import RedHat GPG key'
- ansible.builtin.rpm_key:
- state: present
- key: /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
+ ansible.builtin.command: rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
when:
- gpg_key_directory_permission.stat.mode <= '0755'
- (gpg_installed_fingerprints | difference(gpg_valid_fingerprints)) | length == |
|
@vojtapolasek: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
ggbecker
approved these changes
Mar 3, 2026
matusmarhefka
added a commit
to matusmarhefka/contest
that referenced
this pull request
Mar 3, 2026
In ComplianceAsCode/content#14517 we switched to using Ansible `command` module` instad of `rpm_key`until ansible/ansible#86157 is resolved.
matusmarhefka
added a commit
to matusmarhefka/contest
that referenced
this pull request
Mar 3, 2026
In ComplianceAsCode/content#14517 we switched to using Ansible `command` module instad of `rpm_key` until ansible/ansible#86157 is resolved.
matusmarhefka
added a commit
to matusmarhefka/contest
that referenced
this pull request
Mar 3, 2026
In ComplianceAsCode/content#14517 we switched to using Ansible `command` module instad of `rpm_key` until ansible/ansible#86157 is resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
ansible.builtin.rpm_keymodule withansible.builtin.command: rpm --importin the Ansible remediation for ruleensure_redhat_gpgkey_installed. This makes the Ansible remediation consistent with the Bash remediation approach by callingrpm --importdirectly.Rationale:
ansible.builtin.rpm_keyAnsible module is currently broken when encountering GPG keys with PQC (Post-Quantum Cryptography) signatures, as tracked in ansible/ansible#86157. Usingrpm --importdirectly bypasses the module and works correctly regardless of key signature type.Review Hints:
linux_os/guide/system/software/updating/ensure_redhat_gpgkey_installed/ansible/shared.yml./build_product --datastream-only rhel9key_installed.pass.sh,missing_key.fail.sh,fedora_key.fail.sh), but since only the Ansible remediation is changed (not OVAL checks), existing tests remain valid