Skip to content

Commit

Permalink
Remove EL7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Valantin committed Jul 1, 2024
1 parent 5db0077 commit 0039be4
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 186 deletions.
2 changes: 0 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@

if downcase($facts['kernel']) == 'windows' {
$zabbix_version = '4.4.5'
} elsif $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7' {
$zabbix_version = '5.0'
} else {
$zabbix_version = '6.0'
}
Expand Down
39 changes: 1 addition & 38 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
case $facts['os']['family'] {
'RedHat': {
$majorrelease = $facts['os']['release']['major']
if (versioncmp(fact('os.release.major'), '7') >= 0 and $zabbix_version == '7.0') {
if (versioncmp(fact('os.release.major'), '8') >= 0 and $zabbix_version == '7.0') {
$gpgkey_zabbix = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005'
$gpgkey_nonsupported = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005'
} elsif versioncmp(fact('os.release.major'), '9') >= 0 {
Expand Down Expand Up @@ -59,43 +59,6 @@
gpgkey => $gpgkey_nonsupported,
priority => '1',
}

# Zabbix 5.0 frontend on EL7 has different location.
if ($majorrelease == '7' and $zabbix_version == '5.0') {
$_frontend_repo_location = $frontend_repo_location ? {
undef => "https://repo.zabbix.com/zabbix/${zabbix_version}/rhel/${majorrelease}/\$basearch/frontend",
default => $frontend_repo_location,
}

yumrepo { 'zabbix-frontend':
name => "Zabbix_frontend_${majorrelease}_${facts['os']['architecture']}",
descr => "Zabbix_frontend_${majorrelease}_${facts['os']['architecture']}",
baseurl => $_frontend_repo_location,
gpgcheck => '1',
gpgkey => $gpgkey_zabbix,
priority => '1',
}
}

if ($facts['os']['release']['major'] == '7') {
case $facts['os']['name'] {
'CentOS': {
$scl_package_name = 'centos-release-scl'
}
'OracleLinux': {
$scl_package_name = 'oracle-softwarecollection-release-el7'
}
default: {
$scl_package_name = undef
}
}
if $scl_package_name {
package { 'zabbix-required-scl-repo':
ensure => 'latest',
name => $scl_package_name,
}
}
}
}
'Debian': {
if ($manage_apt) {
Expand Down
8 changes: 0 additions & 8 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,6 @@
Optional[String[1]] $hanodename = $zabbix::params::server_hanodename,
Optional[String[1]] $nodeaddress = $zabbix::params::server_nodeaddress,
) inherits zabbix::params {
# zabbix server 5.2, 5.4 and 6.0 is not supported on RHEL 7.
# https://www.zabbix.com/documentation/current/manual/installation/install_from_packages/rhel_centos
if $facts['os']['family'] == 'RedHat' and versioncmp($zabbix_version, '5.2') >= 0 {
if versioncmp($facts['os']['release']['major'], '7') == 0 {
fail("${facts['os']['family']} ${$facts['os']['release']['major']} is not supported for zabbix::server (version ${$zabbix_version}) (yet)")
}
}

# Only include the repo class if it has not yet been included
unless defined(Class['Zabbix::Repo']) {
class { 'zabbix::repo':
Expand Down
34 changes: 4 additions & 30 deletions manifests/web.pp
Original file line number Diff line number Diff line change
Expand Up @@ -210,24 +210,6 @@
],
}
}
'RedHat': {
$zabbix_web_package = 'zabbix-web'
if ($facts['os']['release']['major'] == '7') {
package { "zabbix-web-${db}-scl":
ensure => $zabbix_package_state,
before => Package[$zabbix_web_package],
require => Class['zabbix::repo'],
tag => 'zabbix',
}
} else {
package { "zabbix-web-${db}":
ensure => $zabbix_package_state,
before => Package[$zabbix_web_package],
require => Class['zabbix::repo'],
tag => 'zabbix',
}
}
}
default: {
$zabbix_web_package = 'zabbix-web'

Expand Down Expand Up @@ -279,26 +261,18 @@
include apache
include apache::mod::dir
if $facts['os']['family'] == 'RedHat' {
if $facts['os']['release']['major'] == '7' {
$fpm_service = 'rh-php72-php-fpm'
# PHP parameters are moved to /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf per package zabbix-web-deps-scl
$fpm_scl_prefix = '/opt/rh/rh-php72'
} else {
$fpm_service = 'php-fpm'
$fpm_scl_prefix = ''
}
include apache::mod::proxy
include apache::mod::proxy_fcgi
$apache_vhost_custom_fragment = ''

service { $fpm_service:
service { 'php-fpm':
ensure => 'running',
enable => true,
}

file { "/etc${fpm_scl_prefix}/php-fpm.d/zabbix.conf":
file { '/etc/php-fpm.d/zabbix.conf':
ensure => file,
notify => Service[$fpm_service],
notify => Service['php-fpm'],
content => epp('zabbix/web/php-fpm.d.zabbix.conf.epp'),
}

Expand All @@ -311,7 +285,7 @@
'php',
'phar',
],
handler => "proxy:unix:/var${fpm_scl_prefix}/run/php-fpm/zabbix.sock|fcgi://localhost",
handler => 'proxy:unix:/var/run/php-fpm/zabbix.sock|fcgi://localhost',
},
],
}
Expand Down
3 changes: 0 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,20 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7",
"8",
"9"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"7",
"8",
"9"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7",
"9"
]
},
Expand Down
2 changes: 0 additions & 2 deletions spec/classes/agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@

context 'with all defaults' do
it { is_expected.to contain_selinux__module('zabbix-agent') } if facts[:os]['family'] == 'RedHat'
it { is_expected.to contain_yumrepo('zabbix-frontend') } if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
it { is_expected.to contain_package('zabbix-required-scl-repo') } if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7' && %w[OracleLinux CentOS].include?(facts[:os]['name'])
it { is_expected.to contain_apt__key('zabbix-A1848F5') } if facts[:os]['family'] == 'Debian'
it { is_expected.to contain_apt__key('zabbix-FBABD5F') } if facts[:os]['family'] == 'Debian'
it { is_expected.to contain_file(include_dir).with_ensure('directory') }
Expand Down
10 changes: 1 addition & 9 deletions spec/classes/database_postgresql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,7 @@
end

supported_versions.each do |zabbix_version|
path = if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
# Path on EL7
if Puppet::Util::Package.versioncmp(zabbix_version, '6.0') >= 0
'/usr/share/zabbix-sql-scripts/postgresql/'
else
"/usr/share/doc/zabbix-*-pgsql-#{zabbix_version}*/"
end
# Path on Debian and EL8
elsif Puppet::Util::Package.versioncmp(zabbix_version, '6.0') >= 0
path = if Puppet::Util::Package.versioncmp(zabbix_version, '6.0') >= 0
'/usr/share/zabbix-sql-scripts/postgresql/'
else
'/usr/share/doc/zabbix-*-pgsql'
Expand Down
2 changes: 0 additions & 2 deletions spec/classes/javagateway_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
it { is_expected.to contain_service('zabbix-java-gateway').with_enable('true') }
it { is_expected.to contain_service('zabbix-java-gateway').with_require(['Package[zabbix-java-gateway]', 'File[/etc/zabbix/zabbix_java_gateway.conf]']) }

it { is_expected.to contain_yumrepo('zabbix-frontend') } if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
it { is_expected.to contain_package('zabbix-required-scl-repo') } if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7' && %w[OracleLinux CentOS].include?(facts[:os]['name'])
it { is_expected.to contain_apt__key('zabbix-A1848F5') } if facts[:os]['family'] == 'Debian'
it { is_expected.to contain_apt__key('zabbix-FBABD5F') } if facts[:os]['family'] == 'Debian'
end
Expand Down
6 changes: 1 addition & 5 deletions spec/classes/proxy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
}
end

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

it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf.d').with_ensure('directory') }
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf.d').with_require('File[/etc/zabbix/zabbix_proxy.conf]') }
Expand Down
39 changes: 18 additions & 21 deletions spec/classes/repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,52 +84,49 @@
end

case facts[:os]['release']['major']
when '7'
context 'on RedHat 7 and Zabbix 5.0' do
when '8', '9'
major = facts[:os]['release']['major']

context "on RedHat #{major} and Zabbix 5.0" do
let :params do
{
zabbix_version: '5.0',
manage_repo: true
}
end

it { is_expected.to contain_yumrepo('zabbix').with_baseurl('https://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/') }
it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591') }
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_yumrepo('zabbix-frontend') }

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('oracle-softwarecollection-release-el7') } if facts[:os]['name'] == 'OracleLinux'
it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/5.0/rhel/#{major}/$basearch/") }
it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') }

Check failure on line 99 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

zabbix::repo on almalinux-8-x86_64 on RedHat 8 and Zabbix 5.0 is expected to contain Yumrepo[zabbix] with gpgkey => "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" Failure/Error: it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } expected that the catalogue would contain Yumrepo[zabbix] with gpgkey set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" but it is set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591"

Check failure on line 99 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

zabbix::repo on oraclelinux-8-x86_64 on RedHat 8 and Zabbix 5.0 is expected to contain Yumrepo[zabbix] with gpgkey => "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" Failure/Error: it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } expected that the catalogue would contain Yumrepo[zabbix] with gpgkey set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" but it is set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591"

Check failure on line 99 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

zabbix::repo on almalinux-8-x86_64 on RedHat 8 and Zabbix 5.0 is expected to contain Yumrepo[zabbix] with gpgkey => "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" Failure/Error: it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } expected that the catalogue would contain Yumrepo[zabbix] with gpgkey set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" but it is set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591"

Check failure on line 99 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

zabbix::repo on oraclelinux-8-x86_64 on RedHat 8 and Zabbix 5.0 is expected to contain Yumrepo[zabbix] with gpgkey => "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" Failure/Error: it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } expected that the catalogue would contain Yumrepo[zabbix] with gpgkey set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" but it is set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591"
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl("https://repo.zabbix.com/non-supported/rhel/#{major}/$basearch/") }
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') }

Check failure on line 101 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

zabbix::repo on almalinux-8-x86_64 on RedHat 8 and Zabbix 5.0 is expected to contain Yumrepo[zabbix-nonsupported] with gpgkey => "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" Failure/Error: it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } expected that the catalogue would contain Yumrepo[zabbix-nonsupported] with gpgkey set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" but it is set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4"

Check failure on line 101 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

zabbix::repo on oraclelinux-8-x86_64 on RedHat 8 and Zabbix 5.0 is expected to contain Yumrepo[zabbix-nonsupported] with gpgkey => "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" Failure/Error: it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } expected that the catalogue would contain Yumrepo[zabbix-nonsupported] with gpgkey set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" but it is set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4"

Check failure on line 101 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

zabbix::repo on almalinux-8-x86_64 on RedHat 8 and Zabbix 5.0 is expected to contain Yumrepo[zabbix-nonsupported] with gpgkey => "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" Failure/Error: it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } expected that the catalogue would contain Yumrepo[zabbix-nonsupported] with gpgkey set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" but it is set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4"

Check failure on line 101 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

zabbix::repo on oraclelinux-8-x86_64 on RedHat 8 and Zabbix 5.0 is expected to contain Yumrepo[zabbix-nonsupported] with gpgkey => "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" Failure/Error: it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } expected that the catalogue would contain Yumrepo[zabbix-nonsupported] with gpgkey set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" but it is set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4"
end
when '9'

context 'on RedHat 9 and Zabbix 5.0' do
context 'on RedHat 9 and Zabbix 6.0' do
let :params do
{
zabbix_version: '5.0',
zabbix_version: '6.0',
manage_repo: true
}
end

it { is_expected.to contain_yumrepo('zabbix').with_baseurl('https://repo.zabbix.com/zabbix/5.0/rhel/9/$basearch/') }
it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/6.0/rhel/#{major}/$basearch/") }
it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') }

Check failure on line 113 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

zabbix::repo on almalinux-8-x86_64 on RedHat 9 and Zabbix 6.0 is expected to contain Yumrepo[zabbix] with gpgkey => "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" Failure/Error: it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } expected that the catalogue would contain Yumrepo[zabbix] with gpgkey set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" but it is set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591"

Check failure on line 113 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

zabbix::repo on oraclelinux-8-x86_64 on RedHat 9 and Zabbix 6.0 is expected to contain Yumrepo[zabbix] with gpgkey => "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" Failure/Error: it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } expected that the catalogue would contain Yumrepo[zabbix] with gpgkey set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" but it is set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591"

Check failure on line 113 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

zabbix::repo on almalinux-8-x86_64 on RedHat 9 and Zabbix 6.0 is expected to contain Yumrepo[zabbix] with gpgkey => "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" Failure/Error: it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } expected that the catalogue would contain Yumrepo[zabbix] with gpgkey set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" but it is set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591"

Check failure on line 113 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

zabbix::repo on oraclelinux-8-x86_64 on RedHat 9 and Zabbix 6.0 is expected to contain Yumrepo[zabbix] with gpgkey => "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" Failure/Error: it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } expected that the catalogue would contain Yumrepo[zabbix] with gpgkey set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" but it is set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591"
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl('https://repo.zabbix.com/non-supported/rhel/9/$basearch/') }
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl("https://repo.zabbix.com/non-supported/rhel/#{major}/$basearch/") }
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') }

Check failure on line 115 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

zabbix::repo on almalinux-8-x86_64 on RedHat 9 and Zabbix 6.0 is expected to contain Yumrepo[zabbix-nonsupported] with gpgkey => "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" Failure/Error: it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } expected that the catalogue would contain Yumrepo[zabbix-nonsupported] with gpgkey set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" but it is set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4"

Check failure on line 115 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

zabbix::repo on almalinux-8-x86_64 on RedHat 9 and Zabbix 6.0 is expected to contain Yumrepo[zabbix-nonsupported] with gpgkey => "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" Failure/Error: it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } expected that the catalogue would contain Yumrepo[zabbix-nonsupported] with gpgkey set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD" but it is set to "https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4"
end

context 'on RedHat 9 and Zabbix 6.0' do
context 'on RedHat 9 and Zabbix 7.0' do
let :params do
{
zabbix_version: '6.0',
zabbix_version: '7.0',
manage_repo: true
}
end

it { is_expected.to contain_yumrepo('zabbix').with_baseurl('https://repo.zabbix.com/zabbix/6.0/rhel/9/$basearch/') }
it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') }
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl('https://repo.zabbix.com/non-supported/rhel/9/$basearch/') }
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') }
it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/6.0/rhel/#{major}/$basearch/") }

Check failure on line 126 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

zabbix::repo on almalinux-8-x86_64 on RedHat 9 and Zabbix 7.0 is expected to contain Yumrepo[zabbix] with baseurl => "https://repo.zabbix.com/zabbix/6.0/rhel/8/$basearch/" Failure/Error: it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/6.0/rhel/#{major}/$basearch/") } expected that the catalogue would contain Yumrepo[zabbix] with baseurl set to "https://repo.zabbix.com/zabbix/6.0/rhel/8/$basearch/" but it is set to "https://repo.zabbix.com/zabbix/7.0/rhel/8/$basearch/"

Check failure on line 126 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

zabbix::repo on almalinux-9-x86_64 on RedHat 9 and Zabbix 7.0 is expected to contain Yumrepo[zabbix] with baseurl => "https://repo.zabbix.com/zabbix/6.0/rhel/9/$basearch/" Failure/Error: it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/6.0/rhel/#{major}/$basearch/") } expected that the catalogue would contain Yumrepo[zabbix] with baseurl set to "https://repo.zabbix.com/zabbix/6.0/rhel/9/$basearch/" but it is set to "https://repo.zabbix.com/zabbix/7.0/rhel/9/$basearch/"

Check failure on line 126 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

zabbix::repo on centos-9-x86_64 on RedHat 9 and Zabbix 7.0 is expected to contain Yumrepo[zabbix] with baseurl => "https://repo.zabbix.com/zabbix/6.0/rhel/9/$basearch/" Failure/Error: it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/6.0/rhel/#{major}/$basearch/") } expected that the catalogue would contain Yumrepo[zabbix] with baseurl set to "https://repo.zabbix.com/zabbix/6.0/rhel/9/$basearch/" but it is set to "https://repo.zabbix.com/zabbix/7.0/rhel/9/$basearch/"

Check failure on line 126 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

zabbix::repo on almalinux-8-x86_64 on RedHat 9 and Zabbix 7.0 is expected to contain Yumrepo[zabbix] with baseurl => "https://repo.zabbix.com/zabbix/6.0/rhel/8/$basearch/" Failure/Error: it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/6.0/rhel/#{major}/$basearch/") } expected that the catalogue would contain Yumrepo[zabbix] with baseurl set to "https://repo.zabbix.com/zabbix/6.0/rhel/8/$basearch/" but it is set to "https://repo.zabbix.com/zabbix/7.0/rhel/8/$basearch/"

Check failure on line 126 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

zabbix::repo on almalinux-9-x86_64 on RedHat 9 and Zabbix 7.0 is expected to contain Yumrepo[zabbix] with baseurl => "https://repo.zabbix.com/zabbix/6.0/rhel/9/$basearch/" Failure/Error: it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/6.0/rhel/#{major}/$basearch/") } expected that the catalogue would contain Yumrepo[zabbix] with baseurl set to "https://repo.zabbix.com/zabbix/6.0/rhel/9/$basearch/" but it is set to "https://repo.zabbix.com/zabbix/7.0/rhel/9/$basearch/"

Check failure on line 126 in spec/classes/repo_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

zabbix::repo on centos-9-x86_64 on RedHat 9 and Zabbix 7.0 is expected to contain Yumrepo[zabbix] with baseurl => "https://repo.zabbix.com/zabbix/6.0/rhel/9/$basearch/" Failure/Error: it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/6.0/rhel/#{major}/$basearch/") } expected that the catalogue would contain Yumrepo[zabbix] with baseurl set to "https://repo.zabbix.com/zabbix/6.0/rhel/9/$basearch/" but it is set to "https://repo.zabbix.com/zabbix/7.0/rhel/9/$basearch/"
it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005') }
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl("https://repo.zabbix.com/non-supported/rhel/#{major}/$basearch/") }
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005') }
end
end
end
Expand Down
9 changes: 1 addition & 8 deletions spec/classes/sender_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
facts
end

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

context 'with all defaults' do
it { is_expected.to contain_class('zabbix::sender') }
Expand Down Expand Up @@ -48,9 +44,6 @@
when 'RedHat'
it { is_expected.to contain_yumrepo('zabbix-nonsupported') }
it { is_expected.to contain_yumrepo('zabbix') }

it { is_expected.to contain_yumrepo('zabbix-frontend') } if facts[:os]['release']['major'] == '7'
it { is_expected.to contain_package('zabbix-required-scl-repo') } if facts[:os]['release']['major'] == '7' && %w[OracleLinux CentOS].include?(facts[:os]['name'])
when 'Debian'
it { is_expected.to contain_apt__source('zabbix') }
it { is_expected.to contain_apt__key('zabbix-A1848F5') }
Expand Down
15 changes: 4 additions & 11 deletions spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
context "on #{os}" do
let(:facts) { facts }

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

describe 'with default settings' do
it { is_expected.to contain_class('zabbix::repo') }
Expand Down Expand Up @@ -52,9 +48,6 @@
describe 'with defaults' do
it { is_expected.to contain_yumrepo('zabbix-nonsupported') }
it { is_expected.to contain_yumrepo('zabbix') }

it { is_expected.to contain_yumrepo('zabbix-frontend') } if facts[:os]['release']['major'] == '7'
it { is_expected.to contain_package('zabbix-required-scl-repo') } if facts[:os]['release']['major'] == '7' && %w[OracleLinux CentOS].include?(facts[:os]['name'])
end
end

Expand Down Expand Up @@ -274,7 +267,7 @@
valuecachesize: '4M',
vmwarecachesize: '8M',
vmwarefrequency: '60',
zabbix_version: '5.0',
zabbix_version: '6.0',
tlsciphercert: 'EECDH+aRSA+AES128:RSA+aRSA+AES128',
tlsciphercert13: 'EECDH+aRSA+AES128:RSA+aRSA+AES128',
tlscipherpsk: 'kECDHEPSK+AES128:kPSK+AES128',
Expand Down Expand Up @@ -359,12 +352,12 @@
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^TLSCipherAll13=EECDH\+aRSA\+AES128:RSA\+aRSA\+AES128:kECDHEPSK\+AES128:kPSK\+AES128$} }
end

context 'with zabbix_server.conf and version 5.0' do
context 'with zabbix_server.conf and version 6.0' do
let :params do
{
socketdir: '/var/run/zabbix',
startodbcpollers: 1,
zabbix_version: '5.0'
zabbix_version: '6.0'
}
end

Expand Down
Loading

0 comments on commit 0039be4

Please sign in to comment.