Skip to content

Make Ansible in audit_rules_immutable idempotent#13950

Merged
ggbecker merged 2 commits into
ComplianceAsCode:masterfrom
jan-cerny:audit_rules_immutable
Sep 30, 2025
Merged

Make Ansible in audit_rules_immutable idempotent#13950
ggbecker merged 2 commits into
ComplianceAsCode:masterfrom
jan-cerny:audit_rules_immutable

Conversation

@jan-cerny
Copy link
Copy Markdown
Collaborator

The current solution executed lineinfile task even if the correct line is present in the file. We will change the code to make the remediation idempotent.

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

Review Hints:

  • ./build_product --playbook-per-rule rhel9
  • manually replace hosts by hosts: all in build/rhel9/playbooks/stig/audit_rules_immutable.yml
  • run ansible-playbook -u root -i YOUR_IP, build/rhel9/playbooks/stig/audit_rules_immutable.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"
  • apart from that, run automatus Tss with --remediate-using ansible

@jan-cerny jan-cerny added this to the 0.1.79 milestone Sep 26, 2025
@jan-cerny jan-cerny added the Ansible Ansible remediation update. label Sep 26, 2025
@Mab879
Copy link
Copy Markdown
Member

Mab879 commented Sep 26, 2025

Can you please double check the Test farming failures? They might be valid.

@ggbecker ggbecker self-assigned this Sep 29, 2025
@ggbecker
Copy link
Copy Markdown
Member

ggbecker commented Sep 29, 2025

Can you please double check the Test farming failures? They might be valid.

maybe this is a project synchronization (with contest) problem, let's restart the failing jobs to see if it helps.

@ggbecker
Copy link
Copy Markdown
Member

/packit retest-failed

@ggbecker
Copy link
Copy Markdown
Member

There is an issue in contest that is being resolved. It's causing the testing-farm failures. We will need to wait until it gets fixed.

@ggbecker
Copy link
Copy Markdown
Member

/packit retest-failed

The current solution executed lineinfile task even if the
correct line is present in the file. We will change the code
to make the remediation idempotent.

Resolves: https://issues.redhat.com/browse/OPENSCAP-6257
@jan-cerny jan-cerny force-pushed the audit_rules_immutable branch from 622039e to 65585fe Compare September 30, 2025 09:40
@jan-cerny
Copy link
Copy Markdown
Collaborator Author

I have rebased this PR on the top of the latest upstream master branch.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Sep 30, 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-platform-compliance 65585fe link true /test e2e-aws-openshift-platform-compliance
ci/prow/e2e-aws-openshift-node-compliance 65585fe link true /test e2e-aws-openshift-node-compliance

Full PR test history. Your PR dashboard.

Details

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 merged commit 7480033 into ComplianceAsCode:master Sep 30, 2025
133 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.

3 participants