diff --git a/manifests/repo.pp b/manifests/repo.pp index 7890343c6..384a6c1a4 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -87,7 +87,7 @@ } } - if ($facts['os']['release']['major'] == '7' and versioncmp($zabbix_version, '5.0') >= 0) { + if ($facts['os']['name'] == 'CentOS' and $facts['os']['release']['major'] == '7' and versioncmp($zabbix_version, '5.0') >= 0) { package { 'zabbix-required-scl-repo': ensure => 'latest', name => 'centos-release-scl', diff --git a/spec/classes/repo_spec.rb b/spec/classes/repo_spec.rb index f3ad90c65..8a7ad7adf 100644 --- a/spec/classes/repo_spec.rb +++ b/spec/classes/repo_spec.rb @@ -110,7 +110,9 @@ 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') } + if (facts[:os]['name'] == 'CentOS') { + it { is_expected.to contain_package('zabbix-required-scl-repo').with_ensure('latest').with_name('centos-release-scl') } + } end when '9'