Skip to content

Commit

Permalink
install Zabbix 6.0 by default everywhere but EL7
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Oct 4, 2023
1 parent f22bc00 commit b13ae56
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
6 changes: 5 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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']) ? {
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 }

if facts[:os]['family'] == 'RedHat' facts[:os]['release']['major'] && == '7'

Check failure on line 42 in spec/classes/agent_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Lint/Syntax: unexpected token tIDENTIFIER (Using Ruby 2.6 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)

Check failure on line 42 in spec/classes/agent_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Lint/Syntax: unexpected token tEQ (Using Ruby 2.6 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)
zabbix_version = '5.0'
else

Check failure on line 44 in spec/classes/agent_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Lint/Syntax: else without rescue is useless (Using Ruby 2.6 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)
zabbix_version = '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
2 changes: 1 addition & 1 deletion spec/classes/sender_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

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'
if facts[:os]['family'] == 'RedHat' facts[:os]['release']['major'] && == '7'

Check failure on line 18 in spec/classes/server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Lint/Syntax: unexpected token tIDENTIFIER (Using Ruby 2.6 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)

Check failure on line 18 in spec/classes/server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Lint/Syntax: unexpected token tEQ (Using Ruby 2.6 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)
zabbix_version = '5.0'
else

Check failure on line 20 in spec/classes/server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Lint/Syntax: else without rescue is useless (Using Ruby 2.6 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)
zabbix_version = '6.0'
end

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

0 comments on commit b13ae56

Please sign in to comment.