diff --git a/CHANGELOG.md b/CHANGELOG.md index b6daa959..ba8f739f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org). +## [v8.1.1] - 2024-08-29 + +### Added + +- Add support for RedHat manage DNF module passthrough for postgresql install. + ## [v8.1.0](https://github.com/puppetlabs/puppetlabs-puppetdb/tree/v8.1.0) - 2024-05-07 [Full Changelog](https://github.com/puppetlabs/puppetlabs-puppetdb/compare/v8.0.1...v8.1.0) diff --git a/manifests/database/postgresql.pp b/manifests/database/postgresql.pp index 825b3fe7..14bcdeef 100644 --- a/manifests/database/postgresql.pp +++ b/manifests/database/postgresql.pp @@ -24,6 +24,10 @@ # @param manage_database # If true, the PostgreSQL database will be managed by this module. Defaults to `true`. # +# @param manage_dnf_module +# If true, the PostgreSQL module will manage the PostgreSQL DNF module. Defaults to `true` +# for RedHat releasever >= '8', otherwise is set to 'false'. +# # @param manage_server # Conditionally manages the PostgreSQL server via `postgresql::server`. Defaults # to `true`. If set to `false`, this class will create the database and user via @@ -79,6 +83,7 @@ $database_port = $puppetdb::params::database_port, $manage_database = $puppetdb::params::manage_database, $manage_server = $puppetdb::params::manage_dbserver, + $manage_dnf_module = $puppetdb::params::manage_dnf_module, $manage_package_repo = $puppetdb::params::manage_pg_repo, $postgres_version = $puppetdb::params::postgres_version, $postgresql_ssl_on = $puppetdb::params::postgresql_ssl_on, @@ -95,6 +100,7 @@ if $manage_server { class { 'postgresql::globals': + manage_dnf_module => $manage_dnf_module, manage_package_repo => $manage_package_repo, version => $postgres_version, } diff --git a/manifests/params.pp b/manifests/params.pp index a3ac541e..157e885b 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -20,12 +20,42 @@ $manage_dnf_module = false if fact('os.family') =~ /RedHat|Debian/ { - $manage_pg_repo = true + $manage_pg_repo = true } else { - $manage_pg_repo = false + $manage_pg_repo = false } - $postgres_version = '14' + # Configure the DNF module for PostgreSQL on RHEL 8 and later + if fact('os.family') == 'RedHat' and versioncmp(fact('os.release.major'), '8') >= 0 { + $manage_dnf_module = true + } else { + $manage_dnf_module = false + } + + # Set the default PostgreSQL version based on the OS family and version + $postgres_version = fact('os.family') ? { + 'RedHat' => fact('os.release.major') ? { + '9' => '15', + '8' => '12', + default => '9.6', + }, + 'Debian' => fact('os.name') ? { + 'Debian' => fact('os.release.major') ? { + '12' => '15', + '11' => '13', + '10' => '11', + default => '9.6', + }, + 'Ubuntu' => fact('os.release.major') ? { + /^22.04$/ => '14', + /^20.04$/ => '12', + /^18.04$/ => '10', + default => '9.6', + }, + default => '9.6', + }, + default => '14', + } $puppetdb_major_version = $puppetdb_version ? { 'latest' => '8', diff --git a/metadata.json b/metadata.json index d925cc19..f32492ca 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-puppetdb", - "version": "8.1.0", + "version": "8.1.1", "author": "puppetlabs", "summary": "Installs PostgreSQL and PuppetDB, sets up the connection to Puppet master.", "license": "Apache-2.0", @@ -29,21 +29,19 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "7", - "8" + "8", + "9" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "7", "8" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ - "7", "8" ] }, @@ -64,7 +62,8 @@ "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "18.04", - "20.04" + "20.04", + "22.04" ] } ], @@ -74,7 +73,6 @@ "version_requirement": ">= 7.0.0 < 9.0.0" } ], - "description": "Module for installing/configuring PuppetDB", "pdk-version": "3.0.1", "template-url": "https://github.com/puppetlabs/pdk-templates#3.0.1", "template-ref": "tags/3.0.1-0-gd13288a"