diff --git a/manifests/params.pp b/manifests/params.pp index 4bd48efe8..b33eb6c4a 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -128,7 +128,11 @@ if downcase($facts['kernel']) == 'windows' { $zabbix_version = '4.4.5' } else { - $zabbix_version = '5.0' + if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7' { + $zabbix_version = '5.0' + } else { + $zabbix_version = '6.0' + } } $manage_startup_script = downcase($facts['kernel']) ? { diff --git a/spec/classes/agent_spec.rb b/spec/classes/agent_spec.rb index 0f9b77c29..986ef51c4 100644 --- a/spec/classes/agent_spec.rb +++ b/spec/classes/agent_spec.rb @@ -37,10 +37,14 @@ else '/etc/zabbix/zabbix_agentd.d' end - zabbix_version = '5.0' - let(:facts) { facts } + if facts[:os]['family'] == 'RedHat' facts[:os]['release']['major'] && == '7' + zabbix_version = '5.0' + else + zabbix_version = '6.0' + end + case facts[:osfamily] when 'Gentoo' package_name = 'zabbix' diff --git a/spec/classes/proxy_spec.rb b/spec/classes/proxy_spec.rb index edbdcb982..585a78c8d 100644 --- a/spec/classes/proxy_spec.rb +++ b/spec/classes/proxy_spec.rb @@ -47,7 +47,7 @@ } end - it { is_expected.to contain_class('zabbix::repo').with_zabbix_version('5.0') } + it { is_expected.to contain_class('zabbix::repo').with_zabbix_version('6.0') } it { is_expected.to contain_package('zabbix-proxy-pgsql').with_require('Class[Zabbix::Repo]') } it { is_expected.to contain_yumrepo('zabbix-nonsupported') } it { is_expected.to contain_yumrepo('zabbix') } @@ -106,7 +106,7 @@ end it { is_expected.to contain_class('zabbix::database::postgresql').with_zabbix_type('proxy') } - it { is_expected.to contain_class('zabbix::database::postgresql').with_zabbix_version('5.0') } + it { is_expected.to contain_class('zabbix::database::postgresql').with_zabbix_version('6.0') } it { is_expected.to contain_class('zabbix::database::postgresql').with_database_name('zabbix_proxy') } it { is_expected.to contain_class('zabbix::database::postgresql').with_database_user('zabbix-proxy') } it { is_expected.to contain_class('zabbix::database::postgresql').with_database_password('zabbix-proxy') } @@ -126,7 +126,7 @@ end it { is_expected.to contain_class('zabbix::database::mysql').with_zabbix_type('proxy') } - it { is_expected.to contain_class('zabbix::database::mysql').with_zabbix_version('5.0') } + it { is_expected.to contain_class('zabbix::database::mysql').with_zabbix_version('6.0') } it { is_expected.to contain_class('zabbix::database::mysql').with_database_name('zabbix_proxy') } it { is_expected.to contain_class('zabbix::database::mysql').with_database_user('zabbix-proxy') } it { is_expected.to contain_class('zabbix::database::mysql').with_database_password('zabbix-proxy') } diff --git a/spec/classes/sender_spec.rb b/spec/classes/sender_spec.rb index e7ac5493b..9bb63178e 100644 --- a/spec/classes/sender_spec.rb +++ b/spec/classes/sender_spec.rb @@ -34,7 +34,7 @@ if %w[Archlinux Gentoo].include?(facts[:osfamily]) it { is_expected.not_to compile.with_all_deps } else - it { is_expected.to contain_class('zabbix::repo').with_zabbix_version('5.0') } + it { is_expected.to contain_class('zabbix::repo').with_zabbix_version('6.0') } it { is_expected.to contain_package('zabbix-sender').with_require('Class[Zabbix::Repo]') } end diff --git a/spec/classes/server_spec.rb b/spec/classes/server_spec.rb index 0933507f9..5c155bf29 100644 --- a/spec/classes/server_spec.rb +++ b/spec/classes/server_spec.rb @@ -15,7 +15,11 @@ context "on #{os}" do let(:facts) { facts } - zabbix_version = '5.0' + if facts[:os]['family'] == 'RedHat' facts[:os]['release']['major'] && == '7' + zabbix_version = '5.0' + else + zabbix_version = '6.0' + end describe 'with default settings' do it { is_expected.to contain_class('zabbix::repo') }