-
Notifications
You must be signed in to change notification settings - Fork 697
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
Fix ansible_ini_file_set #11775
Fix ansible_ini_file_set #11775
Conversation
🤖 A k8s content image for this PR is available at: Click here to see how to deploy itIf you alread have Compliance Operator deployed: Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and: |
Since ignore_spaces is not valid, remove it Fixes ComplianceAsCode#11771
Code Climate has analyzed commit 6addee5 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 59.3% (0.0% change). View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that the ignore_spaces option isn't needed to fix the DISA misalignement, only the option no_extra_spaces that I suggested should be used. https://docs.ansible.com/ansible/latest/collections/community/general/ini_file_module.html#parameter-no_extra_spaces
The fail of Automatus is probably caused by using a container back end where services can't run. I have examined Ansible logs from the GitHub CI runs and I found this: "msg": "Service is in unknown state",
When I run the tests locally using a virtual machine back end, they pass:
jcerny@fedora:~/work/git/scap-security-guide (pr/11775)$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel9 --remediate-using ansible networkmanager_dns_mode
Setting console output to log level INFO
INFO - The base image option has not been specified, choosing libvirt-based test environment.
INFO - Logging into /home/jcerny/work/git/scap-security-guide/logs/rule-custom-2024-04-02-1050/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_networkmanager_dns_mode
INFO - Script correct.pass.sh using profile (all) OK
INFO - Script correct_default.pass.sh using profile (all) OK
INFO - Script missing.fail.sh using profile (all) OK
INFO - Script wrong_value.fail.sh using profile (all) OK
INFO - Script space.fail.sh using profile (all) OK
Description:
Remove
ignore_spaces
fromansible_ini_file_set
Rationale:
Since
ignore_spaces
is not valid on older installs, remove it.Fixes #11771