Skip to content

feat: add initial support for sle16+#863

Merged
richm merged 1 commit intolinux-system-roles:mainfrom
HVSharma12:suse-initial-support
Apr 29, 2026
Merged

feat: add initial support for sle16+#863
richm merged 1 commit intolinux-system-roles:mainfrom
HVSharma12:suse-initial-support

Conversation

@HVSharma12
Copy link
Copy Markdown
Contributor

@HVSharma12 HVSharma12 commented Apr 29, 2026

Enhancement: add initial support for the network role for sle16+

Reason: The role currently fails at package install on SUSE python3-gobject-base does not exist (SUSE ships python3-goject) and typelib-1_0-NM-1_0 ships separately, not as a NetworkManager dep.

Result: update defaults/main to add typelib-1_0-NM-1_0 and manage the -base suffix for SLES.

Issue Tracker Tickets (Jira or BZ if any): na

Summary by Sourcery

Add initial SLES 16+ support to the network role by adjusting package defaults and teaming support guards.

New Features:

  • Support SLES 16+ by selecting the appropriate python-gobject package name based on OS family and adding the required NetworkManager typelib package on SUSE.

Bug Fixes:

  • Prevent package installation failures on SUSE by using python3-gobject instead of the non-existent python3-gobject-base and explicitly installing typelib-1_0-NM-1_0.

Enhancements:

  • Extend teaming configuration safeguards to also block teaming on SUSE 16+ systems where it is not supported.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 29, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds initial SLE16+ support to the network role by adjusting default package names for gobject/NetworkManager dependencies and extending the teaming configuration abort logic to cover newer SUSE releases.

Flow diagram for teaming configuration abort logic on EL10+ and SLE16+

flowchart TD
  A_start["Start task: Abort applying teaming configuration"] --> B_checkTeams["Check if any team-type connections are defined in network_connections or network_state.interfaces"]

  B_checkTeams -->|No team connections| Z_skip["Skip abort task (no team configurations)"]
  B_checkTeams -->|Team connections present| C_checkRHEL["Is distribution in __network_rh_distros AND distribution_major_version > 9?"]

  C_checkRHEL -->|Yes| Y_abort["Fail task: Teaming is not supported on EL10+; use bonding instead"]
  C_checkRHEL -->|No| D_checkSUSE["Is os_family Suse AND distribution_major_version >= 16?"]

  D_checkSUSE -->|Yes| Y_abort
  D_checkSUSE -->|No| Z_skip

  Z_skip --> E_end["End task (no failure)"]
  Y_abort --> E_end
Loading

Flow diagram for default gobject and NetworkManager package resolution with SLE16+ support

flowchart TD
  A_start["Start package defaults evaluation"] --> B_detectPythonMajor["Read ansible_facts.python.version.major"]
  B_detectPythonMajor --> C_detectOSFamily["Read ansible_facts.os_family"]

  C_detectOSFamily --> D_isSuse["Is os_family Suse?"]

  D_isSuse -->|Yes| E_pkgNameSuse["Set __network_packages_default_gobject_packages to python<major>-gobject"]
  D_isSuse -->|No| F_pkgNameBase["Set __network_packages_default_gobject_packages to python<major>-gobject-base"]

  E_pkgNameSuse --> G_buildNMList["Build __network_packages_default_nm"]
  F_pkgNameBase --> G_buildNMList

  G_buildNMList --> H_addBasePackages["Add NetworkManager and gobject packages"]
  H_addBasePackages --> I_addWpaWirelessTeam["Add wpa_supplicant, wireless, and team packages"]
  I_addWpaWirelessTeam --> J_isSuseForTypelib["Is os_family Suse?"]

  J_isSuseForTypelib -->|Yes| K_addTypelib["Add typelib-1_0-NM-1_0 to __network_packages_default_nm"]
  J_isSuseForTypelib -->|No| L_skipTypelib["Do not add typelib-1_0-NM-1_0"]

  K_addTypelib --> M_end["Final __network_packages_default_nm list computed"]
  L_skipTypelib --> M_end
Loading

File-Level Changes

Change Details Files
Adjust default gobject package name to handle SUSE’s python3-gobject without the -base suffix.
  • Update gobject default package template to derive python major version and conditionally append -base only when os_family is not Suse.
  • Document SUSE 16+ behavior in the comments for gobject package resolution.
defaults/main.yml
Ensure NetworkManager’s typelib dependency is explicitly installed on SUSE systems.
  • Extend __network_packages_default_nm to include typelib-1_0-NM-1_0 when os_family is Suse.
  • Keep existing composition of NetworkManager-related package lists intact while adding the conditional SUSE-only package.
defaults/main.yml
Broaden teaming configuration abort conditions to include SUSE 16+ in addition to EL10+.
  • Update the fail task description to note EL10+ and SUSE 16+ restrictions.
  • Refine the when condition to abort if (EL and version > 9) or (SUSE and version >= 16) when teaming is requested, instead of only checking RHEL-family distros.
tasks/main.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The ansible_facts['os_family'] == 'Suse' check in tasks/main.yml does not use the same | d('') default pattern as in defaults/main.yml, which can cause undefined fact failures on some hosts; consider normalizing these checks with a helper var or consistent defaulting.
  • The inline Jinja logic for computing the gobject package name and conditionally adding typelib-1_0-NM-1_0 is getting a bit dense; consider moving the SUSE-specific package selection into separate vars (e.g. __network_packages_suse_nm_extras) to simplify the expressions and make the SUSE behavior easier to adjust later.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `ansible_facts['os_family'] == 'Suse'` check in `tasks/main.yml` does not use the same `| d('')` default pattern as in `defaults/main.yml`, which can cause undefined fact failures on some hosts; consider normalizing these checks with a helper var or consistent defaulting.
- The inline Jinja logic for computing the gobject package name and conditionally adding `typelib-1_0-NM-1_0` is getting a bit dense; consider moving the SUSE-specific package selection into separate vars (e.g. `__network_packages_suse_nm_extras`) to simplify the expressions and make the SUSE behavior easier to adjust later.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Signed-off-by: HVSharma12 <harshvardhan.sharma@suse.com>
@HVSharma12 HVSharma12 force-pushed the suse-initial-support branch from aa4b8db to a22a52a Compare April 29, 2026 03:08
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.71%. Comparing base (1b57520) to head (a22a52a).
⚠️ Report is 90 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #863      +/-   ##
==========================================
- Coverage   43.11%   42.71%   -0.41%     
==========================================
  Files          12       13       +1     
  Lines        3124     3158      +34     
==========================================
+ Hits         1347     1349       +2     
- Misses       1777     1809      +32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@richm
Copy link
Copy Markdown
Contributor

richm commented Apr 29, 2026

[citest]

@richm richm changed the title fix: add initial support for sle16+ feat: add initial support for sle16+ Apr 29, 2026
@richm
Copy link
Copy Markdown
Contributor

richm commented Apr 29, 2026

The errors are not related to the PR

@richm richm merged commit 91a6c42 into linux-system-roles:main Apr 29, 2026
45 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants