Skip to content

Commit 1e39e7d

Browse files
committed
install Zabbix 6.0 by default everywhere but EL7
1 parent 50c8c52 commit 1e39e7d

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

manifests/params.pp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@
127127

128128
if downcase($facts['kernel']) == 'windows' {
129129
$zabbix_version = '4.4.5'
130-
} else {
130+
} elsif $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7' {
131131
$zabbix_version = '5.0'
132+
} else {
133+
$zabbix_version = '6.0'
132134
}
133135

134136
$manage_startup_script = downcase($facts['kernel']) ? {

spec/classes/agent_spec.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@
3737
else
3838
'/etc/zabbix/zabbix_agentd.d'
3939
end
40-
zabbix_version = '5.0'
41-
4240
let(:facts) { facts }
4341

42+
zabbix_version = if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
43+
'5.0'
44+
else
45+
'6.0'
46+
end
47+
4448
case facts[:osfamily]
4549
when 'Gentoo'
4650
package_name = 'zabbix'

spec/classes/proxy_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
}
4848
end
4949

50-
it { is_expected.to contain_class('zabbix::repo').with_zabbix_version('5.0') }
50+
it { is_expected.to contain_class('zabbix::repo').with_zabbix_version('6.0') }
5151
it { is_expected.to contain_package('zabbix-proxy-pgsql').with_require('Class[Zabbix::Repo]') }
5252
it { is_expected.to contain_yumrepo('zabbix-nonsupported') }
5353
it { is_expected.to contain_yumrepo('zabbix') }
@@ -106,7 +106,7 @@
106106
end
107107

108108
it { is_expected.to contain_class('zabbix::database::postgresql').with_zabbix_type('proxy') }
109-
it { is_expected.to contain_class('zabbix::database::postgresql').with_zabbix_version('5.0') }
109+
it { is_expected.to contain_class('zabbix::database::postgresql').with_zabbix_version('6.0') }
110110
it { is_expected.to contain_class('zabbix::database::postgresql').with_database_name('zabbix_proxy') }
111111
it { is_expected.to contain_class('zabbix::database::postgresql').with_database_user('zabbix-proxy') }
112112
it { is_expected.to contain_class('zabbix::database::postgresql').with_database_password('zabbix-proxy') }
@@ -126,7 +126,7 @@
126126
end
127127

128128
it { is_expected.to contain_class('zabbix::database::mysql').with_zabbix_type('proxy') }
129-
it { is_expected.to contain_class('zabbix::database::mysql').with_zabbix_version('5.0') }
129+
it { is_expected.to contain_class('zabbix::database::mysql').with_zabbix_version('6.0') }
130130
it { is_expected.to contain_class('zabbix::database::mysql').with_database_name('zabbix_proxy') }
131131
it { is_expected.to contain_class('zabbix::database::mysql').with_database_user('zabbix-proxy') }
132132
it { is_expected.to contain_class('zabbix::database::mysql').with_database_password('zabbix-proxy') }

spec/classes/sender_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
facts
1616
end
1717

18+
zabbix_version = if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
19+
'5.0'
20+
else
21+
'6.0'
22+
end
23+
1824
context 'with all defaults' do
1925
it { is_expected.to contain_class('zabbix::sender') }
2026
it { is_expected.to contain_class('zabbix::params') }
@@ -34,7 +40,7 @@
3440
if %w[Archlinux Gentoo].include?(facts[:osfamily])
3541
it { is_expected.not_to compile.with_all_deps }
3642
else
37-
it { is_expected.to contain_class('zabbix::repo').with_zabbix_version('5.0') }
43+
it { is_expected.to contain_class('zabbix::repo').with_zabbix_version(zabbix_version) }
3844
it { is_expected.to contain_package('zabbix-sender').with_require('Class[Zabbix::Repo]') }
3945
end
4046

spec/classes/server_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
context "on #{os}" do
1616
let(:facts) { facts }
1717

18-
zabbix_version = '5.0'
18+
zabbix_version = if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
19+
'5.0'
20+
else
21+
'6.0'
22+
end
1923

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

0 commit comments

Comments
 (0)