Skip to content

Commit

Permalink
(SERVER-2500) Use DNF modules to install postgres on RHEL 8
Browse files Browse the repository at this point in the history
The postgresql module added support for DNF modules to install postgres
at specific versions on RHEL 8. However in order to install a
non-default version, like we need to test Puppet Platform 6, which
only supports Postgres 9.6, `manage_dnf_module` must be set to true for
the `puppetlabs-postgresql` module. This commit ensures that mode is set
when isntalling on RHEL 8.

Note that when the default version is being installed (postgres 10 on
RHEL8), the code path that this flag opts into is already being used.
  • Loading branch information
Magisus committed Oct 5, 2021
1 parent 2bed3ef commit ff5eb97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion manifests/database/postgresql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
$manage_database = $puppetdb::params::manage_database,
$manage_server = $puppetdb::params::manage_dbserver,
$manage_package_repo = $puppetdb::params::manage_pg_repo,
$manage_dnf_module = $puppetdb::params::manage_pg_dnf_module,
$postgres_version = $puppetdb::params::postgres_version,
$postgresql_ssl_on = $puppetdb::params::postgresql_ssl_on,
$postgresql_ssl_key_path = $puppetdb::params::postgresql_ssl_key_path,
Expand All @@ -19,10 +20,10 @@
$read_database_password = $puppetdb::params::read_database_password,
$read_database_host = $puppetdb::params::read_database_host
) inherits puppetdb::params {

if $manage_server {
class { '::postgresql::globals':
manage_package_repo => $manage_package_repo,
manage_dnf_module => $manage_dnf_module,
version => $postgres_version,
}
# get the pg server up and running
Expand Down
6 changes: 6 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
$manage_pg_repo = false
}

if $::osfamily =~ /RedHat/ and $facts['os']['release']['major'] == '8' {
$manage_pg_dnf_module = true
} else {
$manage_pg_dnf_module = false
}

if $puppetdb_version in ['latest','present'] or versioncmp($puppetdb_version, '7.0.0') >= 0 {
$postgres_version = '11'
} else {
Expand Down

0 comments on commit ff5eb97

Please sign in to comment.