diff --git a/manifests/database/postgresql.pp b/manifests/database/postgresql.pp index eb73c6588..75016cd57 100644 --- a/manifests/database/postgresql.pp +++ b/manifests/database/postgresql.pp @@ -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 { diff --git a/spec/classes/database_postgresql_spec.rb b/spec/classes/database_postgresql_spec.rb index 49603fed5..4191e6f29 100644 --- a/spec/classes/database_postgresql_spec.rb +++ b/spec/classes/database_postgresql_spec.rb @@ -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 @@ -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