Skip to content

Commit ff5eb97

Browse files
committed
(SERVER-2500) Use DNF modules to install postgres on RHEL 8
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.
1 parent 2bed3ef commit ff5eb97

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

manifests/database/postgresql.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
$manage_database = $puppetdb::params::manage_database,
1111
$manage_server = $puppetdb::params::manage_dbserver,
1212
$manage_package_repo = $puppetdb::params::manage_pg_repo,
13+
$manage_dnf_module = $puppetdb::params::manage_pg_dnf_module,
1314
$postgres_version = $puppetdb::params::postgres_version,
1415
$postgresql_ssl_on = $puppetdb::params::postgresql_ssl_on,
1516
$postgresql_ssl_key_path = $puppetdb::params::postgresql_ssl_key_path,
@@ -19,10 +20,10 @@
1920
$read_database_password = $puppetdb::params::read_database_password,
2021
$read_database_host = $puppetdb::params::read_database_host
2122
) inherits puppetdb::params {
22-
2323
if $manage_server {
2424
class { '::postgresql::globals':
2525
manage_package_repo => $manage_package_repo,
26+
manage_dnf_module => $manage_dnf_module,
2627
version => $postgres_version,
2728
}
2829
# get the pg server up and running

manifests/params.pp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
$manage_pg_repo = false
2626
}
2727

28+
if $::osfamily =~ /RedHat/ and $facts['os']['release']['major'] == '8' {
29+
$manage_pg_dnf_module = true
30+
} else {
31+
$manage_pg_dnf_module = false
32+
}
33+
2834
if $puppetdb_version in ['latest','present'] or versioncmp($puppetdb_version, '7.0.0') >= 0 {
2935
$postgres_version = '11'
3036
} else {

0 commit comments

Comments
 (0)