From b0e6f51ed1ef32732172d5d31caf00091509b62b Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 3 Oct 2023 09:40:30 +0200 Subject: [PATCH] only install SCL repo on CentOS --- manifests/repo.pp | 2 +- spec/classes/repo_spec.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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'