waveclaw / puppet-subscription_manager

Handle Client Registration to RedHat Satellite 6 or Katello
https://rhn.redhat.com
Other
6 stars 34 forks source link

addition of "auto_enable_yum_plugins" makes Puppet stop on EL6 #104

Closed ybrock closed 4 years ago

ybrock commented 4 years ago

Hi,

I have updated to the latest version of the module and since then, all my CentOS6 complain when Puppet runs :

Error: /Stage[main]/Subscription_manager::Config/Rhsm_config[/etc/rhsm/rhsm.conf]: Could not evaluate: Execution of '/usr/sbin/subscription-manager config --rhsm.auto_enable_yum_plugins=1' returned 2: Usage: subscription-manager config [OPTIONS]

subscription-manager: error: no such option: --rhsm.auto_enable_yum_plugins

The old version of subscription-manager used on CentOS 6 (6.10 here) does not provides this parameter.

rpm -qa sub* subscription-manager-1.13.12-1.el6.x86_64

Could we have an option to turn off this behaviour ?

vchepkov commented 4 years ago

Seems you have a very old subscription manager

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.10 (Santiago)
# subscription-manager config --list|grep auto_enable_yum_plugins
   auto_enable_yum_plugins = [1]
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.14.0.20-Unknown
subscription management rules: 5.37
subscription-manager: 1.20.10-8.el6
ybrock commented 4 years ago

Yes indeed ... Actually I though my subscription-manager for CentOS 6 was coming from official CentOS 6 repos, or EPEL 6 repos. But nope, subscription-manager does not exist in these repos.

Actually to solve my issue, I was able to find an updated version of subscription-manager for EL6 and now it's solved.

It's not easy to find a recent version of subscription-manager for CentOS6 on the web The RHEL version is okay, but we're using RHEL and CentOS machines. And I can't use RHEL subscription-manager RPMs on CentOS for licensing reasons (even if it would work).

cat /etc/redhat-release CentOS release 6.10 (Final)

subscription-manager config --list|grep auto_enable_yum_plugins auto_enable_yum_plugins = [1]

subscription-manager version server type: Red Hat Subscription Management subscription management server: 3.14.1-Unknown subscription management rules: 5.37 subscription-manager: 1.20.10-8.el6

Cheers

alanwevans commented 4 years ago

I have also encountered this. Subscription manager from dgoodwin was last built in 2016 so it is stuck on version 1.17.6. The auto_enable_yum_plugins option seems to have been added in subscription-manager 1.20.2. Would it be possible to put in a check for a suitable version around this param?

I had a look at the type/provider and my Puppet::Type-fu is not strong so I am not sure if it belongs in a Type validator or if it's something that should be checked by the Provider. To be flexible it could be implemented perhaps a hash, something like { :auto_enable_yum_plugins: '1.20.2', :some_other_param: '2.0.0' }. Then in the provider collect the subscription-manager version and check the param_min_version hash on create/update and issue a warning if an unsupported param is provided.

-Alan