Skip to content

Commit

Permalink
Merge pull request #95 from vchepkov/auto_enable_yum_plugins
Browse files Browse the repository at this point in the history
add support for rhsm auto_enable_yum_plugins option
  • Loading branch information
waveclaw authored Feb 29, 2020
2 parents 9b39bdc + 010c334 commit f16a74f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
23 changes: 0 additions & 23 deletions .project

This file was deleted.

19 changes: 18 additions & 1 deletion lib/puppet/type/rhsm_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ def self.text_options
end

# These are 'binary' options that map to 1 or 0 in the rhsm.conf file
# they are NOT booleans beacause of PUP-2368 (see PDK-919 for workarounds)
# they are NOT booleans because of PUP-2368 (see PDK-919 for workarounds)

def self.binary_options
{
server_insecure: 'server.insecure',
rhsm_auto_enable_yum_plugins: 'rhsm.auto_enable_yum_plugins',
rhsm_manage_repos: 'rhsm.manage_repos',
rhsm_full_refresh_on_yum: 'rhsm.full_refresh_on_yum',
rhsm_report_package_profile: 'rhsm.report_package_profile',
Expand Down Expand Up @@ -270,6 +271,22 @@ def self.binary_options
end
end

newproperty(:rhsm_auto_enable_yum_plugins) do
desc 'Automatically enable subscription-manager and product-id?'
defaultto 1
newvalues(:true, :false, 0, 1)
munge do |value|
case value
when %r{yes}i, %r{true}i, '1', 1, true, :true, :yes
1
when %r{no}i, %r{false}i, '0', 0, false, :false, :no
0
else
nil
end
end
end

newproperty(:rhsm_manage_repos) do
desc 'Create and use a redhat.repo yum file?'
defaultto 1
Expand Down
4 changes: 4 additions & 0 deletions spec/unit/provider/rhsm_config/subscription_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
rhsm_ca_cert_dir: '/etc/rhsm/ca/',
rhsm_consumercertdir: '/etc/pki/consumer',
rhsm_entitlementcertdir: '/etc/pki/entitlement',
rhsm_auto_enable_yum_plugins: 1,
rhsm_full_refresh_on_yum: 1,
rhsm_manage_repos: 1,
rhsm_pluginconfdir: '/etc/rhsm/pluginconf.d',
Expand Down Expand Up @@ -64,6 +65,7 @@
ca_cert_dir = [/etc/rhsm/ca/]
consumercertdir = [/etc/pki/consumer]
entitlementcertdir = [/etc/pki/entitlement]
auto_enable_yum_plugins = 1
full_refresh_on_yum = 1
manage_repos = [1]
pluginconfdir = [/etc/rhsm/pluginconf.d]
Expand Down Expand Up @@ -92,6 +94,7 @@
rhsm_ca_cert_dir: '/etc/rhsm/ca/',
rhsm_consumercertdir: '/etc/pki/consumer',
rhsm_entitlementcertdir: '/etc/pki/entitlement',
rhsm_auto_enable_yum_plugins: 1,
rhsm_full_refresh_on_yum: 1,
rhsm_manage_repos: 1,
rhsm_pluginconfdir: '/etc/rhsm/pluginconf.d',
Expand Down Expand Up @@ -119,6 +122,7 @@
ca_cert_dir = [/etc/rhsm/ca/]
consumercertdir = [/etc/pki/consumer]
entitlementcertdir = [/etc/pki/entitlement]
auto_enable_yum_plugins = 1
full_refresh_on_yum = 1
manage_repos = [1]
pluginconfdir = [/etc/rhsm/pluginconf.d]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
ca_cert_dir = [/etc/rhsm/ca/]
consumercertdir = [/etc/pki/consumer]
entitlementcertdir = [/etc/pki/entitlement]
auto_enable_yum_plugins = 1
full_refresh_on_yum = 1
manage_repos = [1]
pluginconfdir = [/etc/rhsm/pluginconf.d]
Expand Down

0 comments on commit f16a74f

Please sign in to comment.