Skip to content

Commit 5bc7fa0

Browse files
committed
only try to load versioned schema on EL7
1 parent 4e3f60b commit 5bc7fa0

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

manifests/database/postgresql.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
assert_private()
2525

2626
if ($database_schema_path == false) or ($database_schema_path == '') {
27-
if member(['CentOS', 'RedHat', 'OracleLinux', 'VirtuozzoLinux'], $facts['os']['name']) {
27+
if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7' {
2828
if versioncmp($zabbix_version, '6.0') >= 0 {
2929
$schema_path = '/usr/share/zabbix-sql-scripts/postgresql/'
3030
} else {

spec/classes/database_postgresql_spec.rb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,18 @@
2020
end
2121

2222
supported_versions.each do |zabbix_version|
23-
path = case facts[:os]['name']
24-
when 'CentOS', 'RedHat', 'OracleLinux', 'VirtuozzoLinux'
25-
# Path on RedHat
23+
path = if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
24+
# Path on EL7
2625
if Puppet::Util::Package.versioncmp(zabbix_version, '6.0') >= 0
2726
'/usr/share/zabbix-sql-scripts/postgresql/'
2827
else
2928
"/usr/share/doc/zabbix-*-pgsql-#{zabbix_version}*/"
3029
end
30+
# Path on Debian and EL8
31+
elsif Puppet::Util::Package.versioncmp(zabbix_version, '6.0') >= 0
32+
'/usr/share/zabbix-sql-scripts/postgresql/'
3133
else
32-
# Path on Debian
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'
37-
end
34+
'/usr/share/doc/zabbix-*-pgsql'
3835
end
3936

4037
sql_server = case zabbix_version

0 commit comments

Comments
 (0)