Skip to content

Conversation

@jan-cerny
Copy link
Collaborator

This commit will make Ansible remediations for rule grub2_disable_interactive_boot and grub2_disable_recovery idempotent. Specifically, the tasks that execute the bootloader regenerations (execute grubby or grub2mkconfig) will be guarded by condition that will cause these tasks will be executed only if the configuration files were changed by the previous lineinfile task in the remediation.

Resolves: https://issues.redhat.com/browse/OPENSCAP-6242

Review Hints:

  • ./build_product --playbook-per-rule rhel9
  • manually replace hosts by hosts: all in build/rhel9/playbooks/ospp/grub2_disable_recovery.yml and build/rhel9/playbooks/stig/grub2_disable_interactive_boot.yml
  • run ansible-playbook -u root -i 192.168.124.51, build/rhel9/playbooks/ospp/grub2_disable_recovery.yml at least twice and compare the output of the first run with the second run and so on, verify that the second and next runs don't change anything and that the output contains only "ok" or "skipping"
  • dtto with the second playbook

This commit will make Ansible remediations for rule
grub2_disable_interactive_boot and grub2_disable_recovery
idempotent. Specifically, the tasks that execute the bootloader
regenerations (execute grubby or grub2mkconfig) will be guarded
by condition that will cause these tasks will be executed only
if the configuration files were changed by the previous lineinfile
task in the remediation.

Resolves: https://issues.redhat.com/browse/OPENSCAP-6242
@jan-cerny jan-cerny added this to the 0.1.79 milestone Sep 25, 2025
@jan-cerny jan-cerny added the Ansible Ansible remediation update. label Sep 25, 2025
@openshift-ci
Copy link

openshift-ci bot commented Sep 25, 2025

@jan-cerny: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-openshift-node-compliance 09dd452 link true /test e2e-aws-openshift-node-compliance
ci/prow/e2e-aws-openshift-platform-compliance 09dd452 link true /test e2e-aws-openshift-platform-compliance

Full PR test history. Your PR dashboard.

Instructions 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 ggbecker self-assigned this Sep 29, 2025
Copy link
Member

@ggbecker ggbecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have run the playbooks on a RHEL9 system as instructed in the review hints and both playbooks didn't change the system when executed twice.

@ggbecker ggbecker merged commit 2afd8cf into ComplianceAsCode:master Sep 29, 2025
135 of 138 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ansible Ansible remediation update.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants