Skip to content

Autoregister modules with SUSEConnect - #131

Open
antgamdia wants to merge 5 commits into
mainfrom
TRNT-4463-autoregister
Open

Autoregister modules with SUSEConnect#131
antgamdia wants to merge 5 commits into
mainfrom
TRNT-4463-autoregister

Conversation

@antgamdia

Copy link
Copy Markdown
Contributor

Description

This pull request introduces automatic SUSE module registration for supported roles, making it easier to ensure all required repositories are enabled before package installation. It also improves error handling and updates documentation and dependency management for better user experience and reliability.

Automatic SUSE module registration and improved error handling:

  • Added logic to all relevant roles (e.g., agent, firewall, postgres, prometheus, rabbitmq, rproxy, supportutils, wanda, web) to automatically determine and register required SUSE modules via the suseconnect role when enable_autoregister is set to true. This avoids manual registration steps and ensures all modules are present for package installation.
  • Improved error handling for package installation in agent and prometheus roles: if installation fails due to missing Package Hub, a clear error message is shown with guidance to register the required module
  • Introduced the enable_autoregister variable (default: false) in group_vars/all.yml and documented it in the README.adoc, allowing users to control whether module registration is automatic.
  • Added the suseconnect role as a dependency in requirements.yml and updated the k3s-ansible collection version in devbox/ansible/requirements.yml.

Fixes #TRNT-4463

How was this tested?

CI + limited IRL test

Documentation changes

Yes

Additional information

Example output

More friendly error message

TASK [prometheus : Install package using zypper module] **********************************************************************************************************************************************************
[ERROR]: Task failed: Module failed: No provider of '+golang-github-prometheus-prometheus' found.
Origin: /mnt/c/repos/trento-ansible/roles/prometheus/tasks/main.yml:46:7

....

TASK [prometheus : Fail with Package Hub guidance] ***************************************************************************************************************************************************************
[ERROR]: Task failed: Action failed: Failed to install golang-github-prometheus-prometheus. Register SUSE Package Hub first: SUSEConnect -p PackageHub/16.1/x86_64
Origin: /mnt/c/repos/trento-ansible/roles/prometheus/tasks/main.yml:51:7

...

fatal: [10.144.73.55]: FAILED! => {"changed": false, "msg": "Failed to install golang-github-prometheus-prometheus. Register SUSE Package Hub first: SUSEConnect -p PackageHub/16.1/x86_64"}

Autoregistration enabled

TASK [suseconnect : Manage modules and extensions] ***************************************************************************************************************************************************************
changed: [10.144.73.55] => (item=PackageHub)

...

TASK [prometheus : Install package using zypper module] **********************************************************************************************************************************************************
changed: [10.144.73.55]

Signed-off-by: Antonio Gamez Diaz <antonio.gamez@suse.com>
Signed-off-by: Antonio Gamez Diaz <antonio.gamez@suse.com>
Signed-off-by: Antonio Gamez Diaz <antonio.gamez@suse.com>
Signed-off-by: Antonio Gamez Diaz <antonio.gamez@suse.com>
@antgamdia
antgamdia requested a review from skrech August 5, 2026 18:05
@antgamdia antgamdia added the enhancement New feature or request label Aug 5, 2026
Signed-off-by: Antonio Gamez Diaz <antonio.gamez@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

1 participant