Skip to content

Conversation

@shanedell
Copy link
Contributor

@shanedell shanedell commented Oct 27, 2025

NetworkManager package and PAM stat files fixes

  • Fixed NetworkManager package issue for ubuntu2204 and ubuntu2404.
    • ubuntu didn't need Network manager so this created a custom wirless_disable_interfaces for ubuntu for ansible, similar to how it was done in bash.
  • Resolved issue where using the same register variable outside and inside the block were causing failures.
  • Add rule_title to all tasks for wireless_disable_interfactes ansible.

Description:

  • Update logic so that the NetworkManager package didn't need to be installed for ubuntu2204 and ubuntu2404.
    • The updated logic does the same thing as the bash remediation for disabling wireless interfaces.
  • Resolved issue where using the same register variable outside and inside the block was causing failures.

Rationale:

  • When testing the Ansible playbook for ubuntu2404 I ran into two issues:

    • The playbook was trying to install and look for the NetworkManager package called NetworkManager, however for ubuntu2204 and ubuntu2404 the correct package name is network-manager. This was noted in the product files, it just was not being overriden.
    • When only the register variable of result_pam_file_present was being used for both inside and outside of a block it would cause strange errors.
  • Fixes NetworkManager package not overriden for ubuntu 22.04 and 24.04 #14038

@openshift-ci
Copy link

openshift-ci bot commented Oct 27, 2025

Hi @shanedell. Thanks for your PR.

I'm waiting for a github.com 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.

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.

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Oct 27, 2025
@Mab879 Mab879 added this to the 0.1.79 milestone Oct 28, 2025
@shanedell shanedell force-pushed the network-manager/pam-stat/fix branch from e2261e7 to 8faf447 Compare October 31, 2025 17:10
@jan-cerny jan-cerny self-assigned this Nov 3, 2025
@dodys dodys requested a review from a team November 3, 2025 12:34
@dodys dodys added the Ubuntu Ubuntu product related. label Nov 3, 2025
@dodys
Copy link
Contributor

dodys commented Nov 4, 2025

/packit build

1 similar comment
@dodys
Copy link
Contributor

dodys commented Nov 4, 2025

/packit build

Copy link
Contributor

@dodys dodys left a comment

Choose a reason for hiding this comment

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

please check the packit failures, it seems related to your changes to some of the password rules.
Also for Ubuntu, check the bash remediation, you might want to create an Ansible specific for Ubuntu as for this rule you don't necessarily need network-manager. Not all deployed systems might have it by default.

@shanedell shanedell force-pushed the network-manager/pam-stat/fix branch 3 times, most recently from 2e3a28f to 6307d3b Compare November 5, 2025 13:35
@shanedell
Copy link
Contributor Author

@dodys I am not sure what you are referring with the bash remediation. After building the ubuntu2404 product, there is nothing dealing with NetworkManager it seems inside of the bash remediation files. Is that what you meant for me to check or something different?

@shanedell shanedell requested a review from dodys November 6, 2025 15:22
@dodys
Copy link
Contributor

dodys commented Nov 7, 2025

@dodys I am not sure what you are referring with the bash remediation. After building the ubuntu2404 product, there is nothing dealing with NetworkManager it seems inside of the bash remediation files. Is that what you meant for me to check or something different?

Please check:
https://github.com/ComplianceAsCode/content/blob/master/linux_os/guide/system/network/network-wireless/wireless_software/wireless_disable_interfaces/bash/ubuntu.sh

You don't necessarily need network-manager for this specific rule, specially since people can use different network manager applications. The main point of the rule is to disable wireless interfaces and the ansible should match what we currently do in the bash remediation.

@shanedell shanedell force-pushed the network-manager/pam-stat/fix branch 2 times, most recently from d8deb79 to 4578983 Compare November 7, 2025 19:09
@shanedell
Copy link
Contributor Author

@dodys I believe I should have gotten that change fixed here.

# complexity = low
# disruption = medium

- name: Find wireless marker directories
Copy link
Collaborator

Choose a reason for hiding this comment

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

The convention is to add {{{ rule_title }}} - to the task name. That helps identifying the purpose of the task in the context of whole profile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jan-cerny I added this to both the shared.yml and ubuntu.yml. I did notice in some of the other ansible code this isn't added, would this be a possible future PR you would be willing to accept?

I also noticed some different formatting differences, such as 4 spaces instead of 2 or using yes and no in some places then true and false in others. I believe ansible-lint usually uses 2 and prefers the use of true and false. This one isn't a huge deal but if its something wanting to be consistent with I would be willing to do a PR to do this.

- Fixed NetworkManager package issue for ubuntu2204 and ubuntu2404.
  - ubuntu didn't need Network manager so this created a custom wirless_disable_interfaces for ubuntu for ansible, similar to how it was done in bash.
- Resolved issue where using the same register variable outside and inside the block were causing failures.
- Add rule_title to all tasks for wireless_disable_interfactes ansible.

Signed-off-by: Shane Dell <[email protected]>
@shanedell shanedell force-pushed the network-manager/pam-stat/fix branch from 4578983 to 8c5d2d0 Compare November 12, 2025 18:47
@shanedell shanedell requested a review from jan-cerny November 13, 2025 16:45
@jan-cerny jan-cerny modified the milestones: 0.1.79, 0.1.80 Nov 20, 2025
@jan-cerny
Copy link
Collaborator

@dodys Can you please check this again?

Copy link
Contributor

@dodys dodys 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!

@dodys dodys merged commit b579781 into ComplianceAsCode:master Nov 24, 2025
126 of 130 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test Used by openshift-ci bot. Ubuntu Ubuntu product related.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NetworkManager package not overriden for ubuntu 22.04 and 24.04

4 participants