Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace grep command with ansible find #10579

Conversation

teacup-on-rockingchair
Copy link
Contributor

Description:

Replace usage of grep commandline in favour of find builtin module in ansible, in order to:

  • prevent ansible remediation to fail in case of missing matches
  • in general it is better to use ansible modules than command lines

Rationale:

  • Usage of command module was causing failures, when the executed command did not succeed, so ansible was exiting with failure and interrupting the remediation process

@github-actions
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

rhel8 (from CTF) Environment (using Fedora as testing environment)
Open in Gitpod

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@teacup-on-rockingchair teacup-on-rockingchair force-pushed the drop_cmdline_in_audit_ansible_for_find branch from c9fad54 to e2a6c07 Compare May 17, 2023 04:05
Replace usage of grep commandline in favour of find builtin module in ansible, in order to:
- prevent ansible remediation to fail in case of missing matches
- in general it is better to use ansible modules than command lines
@teacup-on-rockingchair teacup-on-rockingchair force-pushed the drop_cmdline_in_audit_ansible_for_find branch from e2a6c07 to bf79767 Compare May 17, 2023 04:06
@codeclimate
Copy link

codeclimate bot commented May 17, 2023

Code Climate has analyzed commit bf79767 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 52.4% (0.0% change).

View more on Code Climate.

@marcusburghardt marcusburghardt self-assigned this May 17, 2023
@marcusburghardt marcusburghardt added this to the 0.1.68 milestone May 17, 2023
@marcusburghardt marcusburghardt added Ansible Ansible remediation update. enhancement General enhancements to the project. SLES SUSE Linux Enterprise Server product related. labels May 17, 2023
@marcusburghardt marcusburghardt merged commit e751902 into ComplianceAsCode:master May 17, 2023
29 of 32 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. enhancement General enhancements to the project. SLES SUSE Linux Enterprise Server product related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants