Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install Zabbix 6.0 by default everywhere but EL7 #894

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@

if downcase($facts['kernel']) == 'windows' {
$zabbix_version = '4.4.5'
} else {
} elsif $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']) ? {
Expand Down
8 changes: 6 additions & 2 deletions spec/classes/agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@
else
'/etc/zabbix/zabbix_agentd.d'
end
zabbix_version = '5.0'

let(:facts) { facts }

zabbix_version = if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
'5.0'
else
'6.0'
end

case facts[:osfamily]
when 'Gentoo'
package_name = 'zabbix'
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/proxy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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') }
Expand Down Expand Up @@ -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') }
Expand All @@ -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') }
Expand Down
8 changes: 7 additions & 1 deletion spec/classes/sender_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
facts
end

zabbix_version = if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
'5.0'
else
'6.0'
end

context 'with all defaults' do
it { is_expected.to contain_class('zabbix::sender') }
it { is_expected.to contain_class('zabbix::params') }
Expand All @@ -34,7 +40,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(zabbix_version) }
it { is_expected.to contain_package('zabbix-sender').with_require('Class[Zabbix::Repo]') }
end

Expand Down
6 changes: 5 additions & 1 deletion spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
context "on #{os}" do
let(:facts) { facts }

zabbix_version = '5.0'
zabbix_version = if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
'5.0'
else
'6.0'
end

describe 'with default settings' do
it { is_expected.to contain_class('zabbix::repo') }
Expand Down