Skip to content

Commit f6c5249

Browse files
ValantinPh0B1uS
authored andcommitted
Remove EL7 support
1 parent ef0b17e commit f6c5249

18 files changed

+75
-209
lines changed

manifests/params.pp

-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@
130130

131131
if downcase($facts['kernel']) == 'windows' {
132132
$zabbix_version = '4.4.5'
133-
} elsif $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7' {
134-
$zabbix_version = '5.0'
135133
} else {
136134
$zabbix_version = '6.0'
137135
}

manifests/repo.pp

+6-39
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@
2121
case $facts['os']['family'] {
2222
'RedHat': {
2323
$majorrelease = $facts['os']['release']['major']
24-
if (versioncmp(fact('os.release.major'), '7') >= 0 and $zabbix_version == '7.0') {
24+
if versioncmp($zabbix_version, '7.0') >= 0 {
2525
$gpgkey_zabbix = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005'
26-
$gpgkey_nonsupported = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005'
26+
if versioncmp(fact('os.release.major'), '9') >= 0 {
27+
$gpgkey_nonsupported = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD'
28+
} else {
29+
$gpgkey_nonsupported = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005'
30+
}
2731
} elsif versioncmp(fact('os.release.major'), '9') >= 0 {
2832
$gpgkey_zabbix = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD'
2933
$gpgkey_nonsupported = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD'
@@ -59,43 +63,6 @@
5963
gpgkey => $gpgkey_nonsupported,
6064
priority => '1',
6165
}
62-
63-
# Zabbix 5.0 frontend on EL7 has different location.
64-
if ($majorrelease == '7' and $zabbix_version == '5.0') {
65-
$_frontend_repo_location = $frontend_repo_location ? {
66-
undef => "https://repo.zabbix.com/zabbix/${zabbix_version}/rhel/${majorrelease}/\$basearch/frontend",
67-
default => $frontend_repo_location,
68-
}
69-
70-
yumrepo { 'zabbix-frontend':
71-
name => "Zabbix_frontend_${majorrelease}_${facts['os']['architecture']}",
72-
descr => "Zabbix_frontend_${majorrelease}_${facts['os']['architecture']}",
73-
baseurl => $_frontend_repo_location,
74-
gpgcheck => '1',
75-
gpgkey => $gpgkey_zabbix,
76-
priority => '1',
77-
}
78-
}
79-
80-
if ($facts['os']['release']['major'] == '7') {
81-
case $facts['os']['name'] {
82-
'CentOS': {
83-
$scl_package_name = 'centos-release-scl'
84-
}
85-
'OracleLinux': {
86-
$scl_package_name = 'oracle-softwarecollection-release-el7'
87-
}
88-
default: {
89-
$scl_package_name = undef
90-
}
91-
}
92-
if $scl_package_name {
93-
package { 'zabbix-required-scl-repo':
94-
ensure => 'latest',
95-
name => $scl_package_name,
96-
}
97-
}
98-
}
9966
}
10067
'Debian': {
10168
if ($manage_apt) {

manifests/server.pp

-8
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,6 @@
281281
Optional[String[1]] $hanodename = $zabbix::params::server_hanodename,
282282
Optional[String[1]] $nodeaddress = $zabbix::params::server_nodeaddress,
283283
) inherits zabbix::params {
284-
# zabbix server 5.2, 5.4 and 6.0 is not supported on RHEL 7.
285-
# https://www.zabbix.com/documentation/current/manual/installation/install_from_packages/rhel_centos
286-
if $facts['os']['family'] == 'RedHat' and versioncmp($zabbix_version, '5.2') >= 0 {
287-
if versioncmp($facts['os']['release']['major'], '7') == 0 {
288-
fail("${facts['os']['family']} ${$facts['os']['release']['major']} is not supported for zabbix::server (version ${$zabbix_version}) (yet)")
289-
}
290-
}
291-
292284
# Only include the repo class if it has not yet been included
293285
unless defined(Class['Zabbix::Repo']) {
294286
class { 'zabbix::repo':

manifests/web.pp

+4-30
Original file line numberDiff line numberDiff line change
@@ -210,24 +210,6 @@
210210
],
211211
}
212212
}
213-
'RedHat': {
214-
$zabbix_web_package = 'zabbix-web'
215-
if ($facts['os']['release']['major'] == '7') {
216-
package { "zabbix-web-${db}-scl":
217-
ensure => $zabbix_package_state,
218-
before => Package[$zabbix_web_package],
219-
require => Class['zabbix::repo'],
220-
tag => 'zabbix',
221-
}
222-
} else {
223-
package { "zabbix-web-${db}":
224-
ensure => $zabbix_package_state,
225-
before => Package[$zabbix_web_package],
226-
require => Class['zabbix::repo'],
227-
tag => 'zabbix',
228-
}
229-
}
230-
}
231213
default: {
232214
$zabbix_web_package = 'zabbix-web'
233215

@@ -279,26 +261,18 @@
279261
include apache
280262
include apache::mod::dir
281263
if $facts['os']['family'] == 'RedHat' {
282-
if $facts['os']['release']['major'] == '7' {
283-
$fpm_service = 'rh-php72-php-fpm'
284-
# PHP parameters are moved to /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf per package zabbix-web-deps-scl
285-
$fpm_scl_prefix = '/opt/rh/rh-php72'
286-
} else {
287-
$fpm_service = 'php-fpm'
288-
$fpm_scl_prefix = ''
289-
}
290264
include apache::mod::proxy
291265
include apache::mod::proxy_fcgi
292266
$apache_vhost_custom_fragment = ''
293267

294-
service { $fpm_service:
268+
service { 'php-fpm':
295269
ensure => 'running',
296270
enable => true,
297271
}
298272

299-
file { "/etc${fpm_scl_prefix}/php-fpm.d/zabbix.conf":
273+
file { '/etc/php-fpm.d/zabbix.conf':
300274
ensure => file,
301-
notify => Service[$fpm_service],
275+
notify => Service['php-fpm'],
302276
content => epp('zabbix/web/php-fpm.d.zabbix.conf.epp'),
303277
}
304278

@@ -311,7 +285,7 @@
311285
'php',
312286
'phar',
313287
],
314-
handler => "proxy:unix:/var${fpm_scl_prefix}/run/php-fpm/zabbix.sock|fcgi://localhost",
288+
handler => 'proxy:unix:/var/run/php-fpm/zabbix.sock|fcgi://localhost',
315289
},
316290
],
317291
}

metadata.json

-3
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,20 @@
5959
{
6060
"operatingsystem": "RedHat",
6161
"operatingsystemrelease": [
62-
"7",
6362
"8",
6463
"9"
6564
]
6665
},
6766
{
6867
"operatingsystem": "OracleLinux",
6968
"operatingsystemrelease": [
70-
"7",
7169
"8",
7270
"9"
7371
]
7472
},
7573
{
7674
"operatingsystem": "CentOS",
7775
"operatingsystemrelease": [
78-
"7",
7976
"9"
8077
]
8178
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
postgresql::globals::manage_dnf_module: true
3+
postgresql::globals::manage_package_repo: false
4+
postgresql::globals::version: '15'

spec/classes/agent_spec.rb

+1-7
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@
4141
end
4242
let(:facts) { facts }
4343

44-
zabbix_version = if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
45-
'5.0'
46-
else
47-
'6.0'
48-
end
44+
zabbix_version = '6.0'
4945

5046
case facts[:os]['family']
5147
when 'Gentoo'
@@ -66,8 +62,6 @@
6662

6763
context 'with all defaults' do
6864
it { is_expected.to contain_selinux__module('zabbix-agent') } if facts[:os]['family'] == 'RedHat'
69-
it { is_expected.to contain_yumrepo('zabbix-frontend') } if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
70-
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'])
7165
it { is_expected.to contain_apt__key('zabbix-A1848F5') } if facts[:os]['family'] == 'Debian'
7266
it { is_expected.to contain_apt__key('zabbix-FBABD5F') } if facts[:os]['family'] == 'Debian'
7367
it { is_expected.to contain_file(include_dir).with_ensure('directory') }

spec/classes/database_postgresql_spec.rb

+1-9
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,7 @@
2828
end
2929

3030
supported_versions.each do |zabbix_version|
31-
path = if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
32-
# Path on EL7
33-
if Puppet::Util::Package.versioncmp(zabbix_version, '6.0') >= 0
34-
'/usr/share/zabbix-sql-scripts/postgresql/'
35-
else
36-
"/usr/share/doc/zabbix-*-pgsql-#{zabbix_version}*/"
37-
end
38-
# Path on Debian and EL8
39-
elsif Puppet::Util::Package.versioncmp(zabbix_version, '6.0') >= 0
31+
path = if Puppet::Util::Package.versioncmp(zabbix_version, '6.0') >= 0
4032
'/usr/share/zabbix-sql-scripts/postgresql/'
4133
else
4234
'/usr/share/doc/zabbix-*-pgsql'

spec/classes/javagateway_spec.rb

-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
it { is_expected.to contain_service('zabbix-java-gateway').with_enable('true') }
2828
it { is_expected.to contain_service('zabbix-java-gateway').with_require(['Package[zabbix-java-gateway]', 'File[/etc/zabbix/zabbix_java_gateway.conf]']) }
2929

30-
it { is_expected.to contain_yumrepo('zabbix-frontend') } if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
31-
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'])
3230
it { is_expected.to contain_apt__key('zabbix-A1848F5') } if facts[:os]['family'] == 'Debian'
3331
it { is_expected.to contain_apt__key('zabbix-FBABD5F') } if facts[:os]['family'] == 'Debian'
3432
end

spec/classes/proxy_spec.rb

+1-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
}
2222
end
2323

24-
zabbix_version = if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
25-
'5.0'
26-
else
27-
'6.0'
28-
end
24+
zabbix_version = '6.0'
2925

3026
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf.d').with_ensure('directory') }
3127
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf.d').with_require('File[/etc/zabbix/zabbix_proxy.conf]') }

spec/classes/repo_spec.rb

+45-40
Original file line numberDiff line numberDiff line change
@@ -83,54 +83,59 @@
8383
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl('https://example.com/foo') }
8484
end
8585

86-
case facts[:os]['release']['major']
87-
when '7'
88-
context 'on RedHat 7 and Zabbix 5.0' do
89-
let :params do
90-
{
91-
zabbix_version: '5.0',
92-
manage_repo: true
93-
}
94-
end
86+
major = facts[:os]['release']['major']
87+
context "on RedHat #{major} and Zabbix 5.0" do
88+
let :params do
89+
{
90+
zabbix_version: '5.0',
91+
manage_repo: true
92+
}
93+
end
9594

96-
it { is_expected.to contain_yumrepo('zabbix').with_baseurl('https://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/') }
97-
it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591') }
98-
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl('https://repo.zabbix.com/non-supported/rhel/7/$basearch/') }
99-
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4') }
100-
it { is_expected.to contain_yumrepo('zabbix-frontend') }
95+
it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/5.0/rhel/#{major}/$basearch/") }
10196

102-
it { is_expected.to contain_package('zabbix-required-scl-repo').with_ensure('latest').with_name('centos-release-scl') } if facts[:os]['name'] == 'CentOS'
103-
it { is_expected.to contain_package('zabbix-required-scl-repo').with_ensure('latest').with_name('oracle-softwarecollection-release-el7') } if facts[:os]['name'] == 'OracleLinux'
104-
end
105-
when '9'
97+
it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591') } if facts[:os]['release']['major'].to_i < 9
98+
it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } if facts[:os]['release']['major'].to_i >= 9
10699

107-
context 'on RedHat 9 and Zabbix 5.0' do
108-
let :params do
109-
{
110-
zabbix_version: '5.0',
111-
manage_repo: true
112-
}
113-
end
100+
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl("https://repo.zabbix.com/non-supported/rhel/#{major}/$basearch/") }
114101

115-
it { is_expected.to contain_yumrepo('zabbix').with_baseurl('https://repo.zabbix.com/zabbix/5.0/rhel/9/$basearch/') }
116-
it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') }
117-
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl('https://repo.zabbix.com/non-supported/rhel/9/$basearch/') }
118-
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') }
102+
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4') } if facts[:os]['release']['major'].to_i < 9
103+
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } if facts[:os]['release']['major'].to_i >= 9
104+
end
105+
106+
context "on RedHat #{major} and Zabbix 6.0" do
107+
let :params do
108+
{
109+
zabbix_version: '6.0',
110+
manage_repo: true
111+
}
119112
end
120113

121-
context 'on RedHat 9 and Zabbix 6.0' do
122-
let :params do
123-
{
124-
zabbix_version: '6.0',
125-
manage_repo: true
126-
}
127-
end
114+
it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/6.0/rhel/#{major}/$basearch/") }
128115

129-
it { is_expected.to contain_yumrepo('zabbix').with_baseurl('https://repo.zabbix.com/zabbix/6.0/rhel/9/$basearch/') }
130-
it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') }
131-
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl('https://repo.zabbix.com/non-supported/rhel/9/$basearch/') }
132-
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') }
116+
it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591') } if facts[:os]['release']['major'].to_i < 9
117+
it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } if facts[:os]['release']['major'].to_i >= 9
118+
119+
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl("https://repo.zabbix.com/non-supported/rhel/#{major}/$basearch/") }
120+
121+
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4') } if facts[:os]['release']['major'].to_i < 9
122+
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } if facts[:os]['release']['major'].to_i >= 9
123+
end
124+
125+
context "on RedHat #{major} and Zabbix 7.0" do
126+
let :params do
127+
{
128+
zabbix_version: '7.0',
129+
manage_repo: true
130+
}
133131
end
132+
133+
it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/7.0/rhel/#{major}/$basearch/") }
134+
it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005') }
135+
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl("https://repo.zabbix.com/non-supported/rhel/#{major}/$basearch/") }
136+
137+
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005') } if facts[:os]['release']['major'].to_i < 9
138+
it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } if facts[:os]['release']['major'].to_i >= 9
134139
end
135140
end
136141
end

spec/classes/sender_spec.rb

+1-8
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@
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
18+
zabbix_version = '6.0'
2319

2420
context 'with all defaults' do
2521
it { is_expected.to contain_class('zabbix::sender') }
@@ -48,9 +44,6 @@
4844
when 'RedHat'
4945
it { is_expected.to contain_yumrepo('zabbix-nonsupported') }
5046
it { is_expected.to contain_yumrepo('zabbix') }
51-
52-
it { is_expected.to contain_yumrepo('zabbix-frontend') } if facts[:os]['release']['major'] == '7'
53-
it { is_expected.to contain_package('zabbix-required-scl-repo') } if facts[:os]['release']['major'] == '7' && %w[OracleLinux CentOS].include?(facts[:os]['name'])
5447
when 'Debian'
5548
it { is_expected.to contain_apt__source('zabbix') }
5649
it { is_expected.to contain_apt__key('zabbix-A1848F5') }

0 commit comments

Comments
 (0)