Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions data/os/RedHat/10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
# As of v10.6.1, puppetlabs/postgresql does not have EL10 support/data
openvoxdb::postgres_version: '16'
14 changes: 14 additions & 0 deletions hiera.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
version: 5

hierarchy:
- name: "OS version"
path: "os/%{facts.os.family}/%{facts.os.name}/%{facts.os.release.major}.yaml"
Comment thread
d1nuc0m marked this conversation as resolved.
- name: "OS variant"
path: "os/%{facts.os.family}/%{facts.os.name}.yaml"
- name: "OS family/major"
path: "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
- name: "OS family"
path: "os/%{facts.os.family}.yaml"
- name: "common"
path: "common.yaml"
2 changes: 2 additions & 0 deletions manifests/database/postgresql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@
) inherits openvoxdb::params {
if $manage_server {
class { 'postgresql::globals':
manage_dnf_module => false, # disable DNF module on EL8, EL9 and EL10
manage_package_repo => $manage_package_repo,
version => $postgres_version,
}

# get the pg server up and running
class { 'postgresql::server':
ip_mask_allow_all_users => '0.0.0.0/0',
Expand Down
15 changes: 10 additions & 5 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@
"operatingsystem": "AlmaLinux",
"operatingsystemrelease": [
"8",
"9"
"9",
"10"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"9"
"9",
"10"
]
},
{
Expand All @@ -51,21 +53,24 @@
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"8",
"9"
"9",
"10"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"8",
"9"
"9",
"10"
]
},
{
"operatingsystem": "Rocky",
"operatingsystemrelease": [
"8",
"9"
"9",
"10"
]
},
{
Expand Down
26 changes: 17 additions & 9 deletions spec/support/acceptance/shared/puppetserver.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,25 @@
# TODO: backport to litmusimage, required for serverspec port tests
package { 'iproute': ensure => installed }

# TODO: rework this hack, maybe not needed for newer version of postgresl module?
# EL 8 and 9 ship a built-in DNF module for postgresql that must be disabled
# before installing from the upstream PGDG repo. EL 10 dropped the module stream.
Comment thread
d1nuc0m marked this conversation as resolved.
if versioncmp($facts['os']['release']['major'], '8') >= 0 {
package { 'disable-builtin-dnf-postgresql-module':
ensure => 'disabled',
name => 'postgresql',
provider => 'dnfmodule',
}
if versioncmp($facts['os']['release']['major'], '10') < 0 {
# EL 8 and 9
package { 'disable-builtin-dnf-postgresql-module':
ensure => 'disabled',
name => 'postgresql',
provider => 'dnfmodule',
}

Yumrepo <| tag == 'postgresql::repo' |>
-> Package['disable-dnf-postgresql-module']
-> Package <| tag == 'postgresql' |>
Yumrepo <| tag == 'postgresql::repo' |>
-> Package['disable-builtin-dnf-postgresql-module']
-> Package <| tag == 'postgresql' |>
} else {
# EL 10
Yumrepo <| tag == 'postgresql::repo' |>
-> Package <| tag == 'postgresql' |>
}
}
}

Expand Down
17 changes: 13 additions & 4 deletions spec/unit/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,19 @@

describe 'without managed postgresql' do
let :pre_condition do
<<-HEREDOC
class { 'postgresql::server':
}
HEREDOC
if facts.dig(:os, 'family') == 'RedHat' && facts.dig(:os, 'release', 'major') == '10'
<<-HEREDOC
class { 'postgresql::globals':
version => '16',
Copy link
Copy Markdown
Contributor

@corporate-gadfly corporate-gadfly Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is our only chance to sneak in the version number into the downstream postgresql::server module.

For EL10, we replace a single-line with two classes.

}
-> class { 'postgresql::server': }
HEREDOC
else
<<-HEREDOC
class { 'postgresql::server':
}
HEREDOC
end
end

let :params do
Expand Down
Loading