community.general icon indicating copy to clipboard operation
community.general copied to clipboard

redhat_subscription: add new pools keeping current consumed

Open felmasper opened this issue 3 years ago • 3 comments

Summary

I'd like to append new pools/products to the already consumed ones. User/password or activationkey would not be needed in this case -- system is already registered. The behavior would be similar to rhsm_repos' purge parameter. In redhat_subscription, purge would default to true.

Issue Type

Feature Idea

Component Name

redhat_subscription

Additional Information

- redhat_subscription:
    pools: "epel"
    purge: no
  become: yes

Code of Conduct

  • [X] I agree to follow the Ansible Code of Conduct

felmasper avatar Dec 08 '21 14:12 felmasper

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 avatar Dec 08 '21 14:12 ansibullbot

cc @alikins @barnabycourt @kahowell click here for bot help

ansibullbot avatar Dec 08 '21 14:12 ansibullbot

I agree we need this implementation.

whoamiUNIX avatar Aug 01 '22 07:08 whoamiUNIX

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 avatar Nov 05 '22 09:11 ansibullbot

I have agreed with this idea in the past. Even to the point that I modified redhat_subscription.py to skip the removal of serials/poolIDs it found that were not explicitly provided. After trying to manage that custom module across the update from ansible 2.7 to 2.9 and beyond I started thinking of another way.

I was previously adding specific pools for specific roles by running redhat_subscription in those role main task. Now I build a composite list of pools as a host (or role) specific variable ahead of time. All my centos 7 hosts get a baseline of my CentOS 7 and EPEL pool IDs. Then any specific role gets its required pool IDs added to that list variable. Then I run the redhat_subscription once in a baseline OS role.

All that said, I do think it would make sense to have an append state or a purge parameter as you suggest.

eightnoneone avatar Nov 15 '22 20:11 eightnoneone

I have agreed with this idea in the past. Even to the point that I modified redhat_subscription.py to skip the removal of serials/poolIDs it found that were not explicitly provided. After trying to manage that custom module across the update from ansible 2.7 to 2.9 and beyond I started thinking of another way.

@eightnoneone Any chance you could share that modified version? Perhaps someone here could adapt it so that it would be PR worthy.

gardar avatar Apr 13 '23 14:04 gardar

cc @cnsnyder @ptoscano click here for bot help

ansibullbot avatar Apr 20 '23 06:04 ansibullbot