puppetlabs-puppetdb icon indicating copy to clipboard operation
puppetlabs-puppetdb copied to clipboard

(SERVER-2500) Use DNF modules to install postgres on RHEL 8

Open Magisus opened this issue 4 years ago • 8 comments

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.

Magisus avatar Oct 05 '21 01:10 Magisus

puppetdb::database::postgresql is a class

that may have no external impact to Forge modules.

puppetdb::params is a class

that may have no external impact to Forge modules.

This module is declared in 33 of 578 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

For the postgresql module change, see https://github.com/puppetlabs/puppetlabs-postgresql/pull/1239.

This resolves the following issue seen when trying to enable install PDB with this module on RHEL 8 in our acceptance tests:

Error: Execution of '/usr/bin/dnf -d 0 -e 1 -y install postgresql96-server' returned 1: Error: Unable to find a match

This is because the package string is invalid for dnf version selection, we need to be using the top branch in this conditional. When using the module with this change, after install PDB, I am able to see

=> postgres --version
postgres (PostgreSQL) 9.6.22

Magisus avatar Oct 05 '21 01:10 Magisus

I wasn't sure if this should be exposed to users or not.

Magisus avatar Oct 05 '21 01:10 Magisus

I tested this on 7.x and was surprised to see us still trying to install postgres 9.6 there... then I realized this module hasn't been released in a while, so we were not getting https://github.com/puppetlabs/puppetlabs-puppetdb/commit/3ea57a587d33e3105962d0e5f4f4b3196feb48c3. I think this is necessary even after that goes in, though, since we're still using a non-default version (11 instead of 10).

Magisus avatar Oct 05 '21 16:10 Magisus

On further investigation, I think this may not be what we want. DNF modules can't be used to install Postgres 11, which means with this change we are even more broken in Puppet 7 land.

It seems what we really want is something that follows these instructions:

# Install the repository RPM:
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

# Disable the built-in PostgreSQL module:
sudo dnf -qy module disable postgresql

# Install PostgreSQL:
sudo dnf install -y postgresql11-server

Not sure yet if there's a way to force the postgresql module to do that.

Magisus avatar Oct 05 '21 23:10 Magisus

I'm returning to the world of Puppet after a four year break. Is there any reason this project is tied to Postgresql 9.6 and 11? I've installed PSQL 10, 11 and 12 and (so far) haven't had any issues.

bschonec avatar Mar 29 '22 19:03 bschonec

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Apr 19 '23 21:04 CLAassistant

psql 11 is EOL and 12 is the oldest version that we need to worry about supporting.

jhoblitt avatar Mar 28 '24 17:03 jhoblitt