Skip to content
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

subscription-manager release --set=$VAR don't work as expected #9685

Open
1 task done
DirectorSloan opened this issue Feb 4, 2025 · 3 comments
Open
1 task done
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type) redhat_subscription

Comments

@DirectorSloan
Copy link

Summary

I want to use the release pinning in ansible. Target systems are already registered successfully with the same module.


If I can provide any more information to help, please let me know.

Issue Type

Bug Report

Component Name

community.general.redhat_subscription

Ansible Version

Environment:

ansible-host ~/ansible-lab $ ansible --version
ansible [core 2.17.4]
  config file = /home/user/ansible-gpfs-lab/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/venv-ansible/lib/python3.12/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ben/venv-ansible/bin/ansible
  python version = 3.12.8 (main, Jan 29 2025, 08:30:51) [GCC 14.2.1 20241221] (/home/user/venv-ansible/bin/python)
  jinja version = 3.1.4
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general
# /home/user/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 10.3.0 

Configuration

$ ansible-config dump --only-changed
CONFIG_FILE() = None
EDITOR(env: EDITOR) = /bin/nano
PAGER(env: PAGER) = /usr/bin/less

OS / Environment

Subscription Manager stack on targets is the following (RHEL 9.4):

[user@ansible-host ~]# rpm -qa | grep -i subscription-manager
subscription-manager-rhsm-certificates-20220623-1.el9.noarch
libdnf-plugin-subscription-manager-1.29.40-1.el9.x86_64
python3-subscription-manager-rhsm-1.29.40-1.el9.x86_64
subscription-manager-1.29.40-1.el9.x86_64

Steps to Reproduce

- name: Pinning the os release if variable is set.
  community.general.redhat_subscription:
    release: "{{ redhat_subscription_manager_os_release }}"
  become: true
  when: redhat_subscription_manager_os_release is defined

Expected Results

changed

when no pinning is set or if pinning is set to another version (tested both).

Actual Results

returns green [ok] all the time.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) redhat_subscription labels Feb 4, 2025
@ptoscano
Copy link
Contributor

ptoscano commented Feb 4, 2025

Is the system already registered? The module has historically done changes only when actually registering, and starting from community.general 6.5.0 it started to apply changes also when there was not a status change required (i.e. the system was not registered, and the execution would register the system).

For already registered systems, the module to be used is rhsm_release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type) redhat_subscription
Projects
None yet
Development

No branches or pull requests

3 participants