diff --git a/manifests/repo.pp b/manifests/repo.pp index 5527f9cda..69d3845d0 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -17,7 +17,7 @@ Optional[Stdlib::HTTPUrl] $unsupported_repo_location = $zabbix::params::unsupported_repo_location, String[1] $zabbix_version = $zabbix::params::zabbix_version, ) inherits zabbix::params { - if ($manage_repo) { + if $manage_repo { case $facts['os']['name'] { 'PSBM': { $majorrelease = '6' @@ -81,6 +81,13 @@ priority => '1', } } + + if ($facts['os']['release']['major'] == '7' and versioncmp($zabbix_version, '5.0') >= 0) { + package { 'zabbix-required-scl-repo': + ensure => 'latest', + name => 'centos-release-scl', + } + } } 'Debian': { if ($manage_apt) { diff --git a/manifests/web.pp b/manifests/web.pp index 09b497e9f..2dbe2386d 100644 --- a/manifests/web.pp +++ b/manifests/web.pp @@ -262,11 +262,6 @@ 'CentOS', 'RedHat': { $zabbix_web_package = 'zabbix-web' if ($facts['os']['release']['major'] == '7' and versioncmp($zabbix_version, '5.0') >= 0) { - package { 'zabbix-required-scl-repo': - ensure => 'latest', - name => 'centos-release-scl', - } - package { "zabbix-web-${db}-scl": ensure => $zabbix_package_state, before => Package[$zabbix_web_package], diff --git a/spec/classes/repo_spec.rb b/spec/classes/repo_spec.rb index 7ae84bea5..502217e4b 100644 --- a/spec/classes/repo_spec.rb +++ b/spec/classes/repo_spec.rb @@ -128,6 +128,8 @@ it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591') } it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl('https://repo.zabbix.com/non-supported/rhel/7/$basearch/') } it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4') } + + it { is_expected.to contain_package('zabbix-required-scl-repo').with_ensure('latest').with_name('centos-release-scl') } end end end