diff --git a/README.md b/README.md index 7057200..febd042 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ class { 'rhsm': Use `rh_repo` type to add a repository: ```puppet -rh_repo { 'rhel-7-server-extras-rpms': +rh_repo { 'codeready-builder-for-rhel-8-x86_64-rpms': ensure => present, } ``` @@ -101,9 +101,9 @@ class { 'rhsm': rh_user => 'myuser', rh_password => 'mypassword', enabled_repo_ids => [ - 'rhel-7-server-rpms', - 'rhel-7-server-optional-rpms' - ] + 'rhel-8-for-x86_64-baseos-rpms', + 'rhel-8-for-x86_64-appstream-rpms', + ], } ``` @@ -113,8 +113,8 @@ Alternatively, hiera can be utilized to specify these arguments. rhsm::rh_user: myuser rhsm::rh_password: mypassword rhsm::enabled_repo_ids: - - 'rhel-7-server-rpms', - - 'rhel-7-server-optional-rpms' + - 'rhel-8-for-x86_64-baseos-rpms' + - 'rhel-8-for-x86_64-appstream-rpms' ``` ### Satellite 6 @@ -122,7 +122,7 @@ Registering with Red Hat Satellite 6 needs some additional settings. ```puppet class { 'rhsm': - activationkey => 'act-lce-rhel-7,act-product', + activationkey => 'act-lce-rhel-8,act-product', org => 'satellite_organization', servername => 'satellite.example.com', serverprefix => '/rhsm', diff --git a/manifests/init.pp b/manifests/init.pp index 07f0687..b338118 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -173,11 +173,7 @@ } unless empty($plugin_settings) { - if $facts['os']['release']['major'] < '8' { - $plugin_path = '/etc/yum/pluginconf.d/subscription-manager.conf' - } else { - $plugin_path = '/etc/dnf/plugins/subscription-manager.conf' - } + $plugin_path = '/etc/dnf/plugins/subscription-manager.conf' file { $plugin_path: ensure => 'file', diff --git a/metadata.json b/metadata.json index 6c0b5ce..90764ce 100644 --- a/metadata.json +++ b/metadata.json @@ -23,8 +23,6 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "6", - "7", "8" ] } diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index b936daf..8c3a6d7 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -38,24 +38,13 @@ ) end - if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] < '8' - it do - is_expected.to contain_file('/etc/yum/pluginconf.d/subscription-manager.conf'). - with_owner('root'). - with_group('root'). - with_mode('0644'). - with_content(%r{^\[main\]$}). - with_content(%r{^enabled=1$}) - end - else - it do - is_expected.to contain_file('/etc/dnf/plugins/subscription-manager.conf'). - with_owner('root'). - with_group('root'). - with_mode('0644'). - with_content(%r{^\[main\]$}). - with_content(%r{^enabled=1$}) - end + it do + is_expected.to contain_file('/etc/dnf/plugins/subscription-manager.conf'). + with_owner('root'). + with_group('root'). + with_mode('0644'). + with_content(%r{^\[main\]$}). + with_content(%r{^enabled=1$}) end end @@ -160,27 +149,14 @@ is_expected.not_to contain_file('/etc/yum.repos.d/redhat.repo') end - if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] < '8' - # disable_system_repos doesn't actually do anything on EL6 or 7 - it do - is_expected.to contain_file('/etc/yum/pluginconf.d/subscription-manager.conf'). - with_owner('root'). - with_group('root'). - with_mode('0644'). - with_content(%r{^\[main\]$}). - with_content(%r{^enabled=0$}). - with_content(%r{^disable_system_repos=1$}) - end - else - it do - is_expected.to contain_file('/etc/dnf/plugins/subscription-manager.conf'). - with_owner('root'). - with_group('root'). - with_mode('0644'). - with_content(%r{^\[main\]$}). - with_content(%r{^enabled=0$}). - with_content(%r{^disable_system_repos=1$}) - end + it do + is_expected.to contain_file('/etc/dnf/plugins/subscription-manager.conf'). + with_owner('root'). + with_group('root'). + with_mode('0644'). + with_content(%r{^\[main\]$}). + with_content(%r{^enabled=0$}). + with_content(%r{^disable_system_repos=1$}) end end end