Skip to content

Commit

Permalink
only try to load versioned schema on EL7
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Oct 4, 2023
1 parent 2369729 commit 2a82508
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifests/database/postgresql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
assert_private()

if ($database_schema_path == false) or ($database_schema_path == '') {
if member(['CentOS', 'RedHat', 'OracleLinux', 'VirtuozzoLinux'], $facts['os']['name']) {
if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7' {
if versioncmp($zabbix_version, '6.0') >= 0 {
$schema_path = '/usr/share/zabbix-sql-scripts/postgresql/'
} elsif versioncmp($zabbix_version, '5.4') >= 0 {
Expand Down
7 changes: 3 additions & 4 deletions spec/classes/database_postgresql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
end

supported_versions.each do |zabbix_version|
path = case facts[:os]['name']
when 'CentOS', 'RedHat', 'OracleLinux', 'VirtuozzoLinux'
# Path on RedHat
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/'
elsif Puppet::Util::Package.versioncmp(zabbix_version, '5.4') >= 0
Expand All @@ -31,7 +30,7 @@
"/usr/share/doc/zabbix-*-pgsql-#{zabbix_version}*/"
end
else
# Path on Debian
# Path on Debian and EL8
if Puppet::Util::Package.versioncmp(zabbix_version, '6.0') >= 0
'/usr/share/zabbix-sql-scripts/postgresql/'
elsif Puppet::Util::Package.versioncmp(zabbix_version, '5.4') >= 0
Expand Down

0 comments on commit 2a82508

Please sign in to comment.