Skip to content

Commit feb6014

Browse files
authored
Merge pull request #970 from Valantin/del/el7
Remove EL7 support
2 parents 24993d4 + 1804ea3 commit feb6014

File tree

18 files changed

+75
-209
lines changed

18 files changed

+75
-209
lines changed

manifests/params.pp

Lines changed: 0 additions & 2 deletions
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

Lines changed: 6 additions & 39 deletions
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

Lines changed: 0 additions & 8 deletions
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

Lines changed: 4 additions & 30 deletions
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

Lines changed: 0 additions & 3 deletions
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
},
Lines changed: 4 additions & 0 deletions
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

Lines changed: 1 addition & 7 deletions
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

Lines changed: 1 addition & 9 deletions
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

Lines changed: 0 additions & 2 deletions
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

Lines changed: 1 addition & 5 deletions
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]') }

0 commit comments

Comments
 (0)