Skip to content

Changes in template service_disabled - ansible part#11645

Merged
marcusburghardt merged 3 commits into
ComplianceAsCode:masterfrom
rumch-se:template_change_ansible
Mar 7, 2024
Merged

Changes in template service_disabled - ansible part#11645
marcusburghardt merged 3 commits into
ComplianceAsCode:masterfrom
rumch-se:template_change_ansible

Conversation

@rumch-se
Copy link
Copy Markdown
Contributor

@rumch-se rumch-se commented Mar 4, 2024

Description:

  • Changes in ansible template which is a part of service_disabled

Rationale:

  • At the moment the current ansible template:

  • does not check if the service exists and there are cases when it tries to disable services which are not exists. Because of that we have a fatal error like this - when we want to disable for example the service zebra via the rule "service_zebra_disabled"
    TASK [Disable service zebra] ********************************************************************************************************
    fatal: [localhost]: FAILED! => {"changed": false, "msg": "Could not find the requested service zebra.service: host"}
    [WARNING]: noop task does not support when conditional

  • uses values "yes" and "no" for attributes which according the official ansible documentation are boolean and they have to be true or false

@openshift-ci openshift-ci Bot added the needs-ok-to-test Used by openshift-ci bot. label Mar 4, 2024
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 4, 2024

Hi @rumch-se. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 4, 2024

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

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 4, 2024

🤖 A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:11645
This image was built from commit: f00e0ae

Click here to see how to deploy it

If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:11645

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:11645 make deploy-local

@marcusburghardt marcusburghardt added the Ansible Ansible remediation update. label Mar 4, 2024
@marcusburghardt marcusburghardt added this to the 0.1.73 milestone Mar 4, 2024
@marcusburghardt marcusburghardt self-assigned this Mar 4, 2024
Comment thread shared/templates/service_disabled/ansible.template Outdated
Comment thread shared/templates/service_disabled/ansible.template Outdated
@rumch-se
Copy link
Copy Markdown
Contributor Author

rumch-se commented Mar 6, 2024

Hello @marcusburghardt
Thank you for your feedback.

I decided to make the code more simple and clear. I used as reference the code of the template socket.disable.

Have a nice day
Rumen

Comment thread shared/templates/service_disabled/ansible.template Outdated
@rumch-se
Copy link
Copy Markdown
Contributor Author

rumch-se commented Mar 6, 2024

Hello @marcusburghardt
I have implemented the proposed changes in my last commit.
Have a nice day
Rumen

@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit f00e0ae 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.8% (0.0% change).

View more on Code Climate.

Copy link
Copy Markdown
Member

@marcusburghardt marcusburghardt left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks

@marcusburghardt marcusburghardt merged commit 9753afb into ComplianceAsCode:master Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ansible Ansible remediation update. needs-ok-to-test Used by openshift-ci bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants