Skip to content

feat: add EL10 support#28

Merged
corporate-gadfly merged 1 commit intovoxpupuli:mainfrom
d1nuc0m:el10
Apr 17, 2026
Merged

feat: add EL10 support#28
corporate-gadfly merged 1 commit intovoxpupuli:mainfrom
d1nuc0m:el10

Conversation

@d1nuc0m
Copy link
Copy Markdown
Contributor

@d1nuc0m d1nuc0m commented Mar 24, 2026

Pull Request (PR) description

Add EL10 support and tests

This Pull Request (PR) fixes the following issues

n/a

@d1nuc0m d1nuc0m force-pushed the el10 branch 3 times, most recently from 373218a to 0dd504a Compare March 24, 2026 09:33
@d1nuc0m
Copy link
Copy Markdown
Contributor Author

d1nuc0m commented Mar 24, 2026

Issue: puppetlabs/postgresql defines default version in a manfest, and it does not have EL10. Tried to force it in Hiera but did not succeed... @corporate-gadfly can I ask for help again in hiera? :D

@corporate-gadfly
Copy link
Copy Markdown
Contributor

corporate-gadfly commented Mar 25, 2026

@d1nuc0m : What you are trying to do in this PR won't work, IMO. APL only works in your own module, not in some other module.

Your best bet is to add support for newer OS in https://github.com/puppetlabs/puppetlabs-postgresql/blob/main/metadata.json (I know it is not an openvox module). Get that released, and then bump the supported OS in this module.

HTH.

@d1nuc0m
Copy link
Copy Markdown
Contributor Author

d1nuc0m commented Mar 25, 2026

@corporate-gadfly thank you, I though it was possible... there already is PR 1650, guess I'll have to wait

@d1nuc0m d1nuc0m force-pushed the el10 branch 8 times, most recently from 66e1559 to 5c17a4c Compare April 13, 2026 10:00
@corporate-gadfly
Copy link
Copy Markdown
Contributor

corporate-gadfly commented Apr 14, 2026

@d1nuc0m : I had a chance to look at the remaining failures.

I believe the failures are happening because of the rigid class here in the spec:

<<-HEREDOC
class { 'postgresql::server':
}
HEREDOC

What about the following diff which swaps in a different manifest (temporarily) for EL10 support (until the other module itself starts supporting EL10)?

diff --git a/spec/unit/classes/init_spec.rb b/spec/unit/classes/init_spec.rb
index 3c07f7f..51b0d42 100644
--- a/spec/unit/classes/init_spec.rb
+++ b/spec/unit/classes/init_spec.rb
@@ -17,12 +17,23 @@ describe 'openvoxdb', type: :class do
         it { is_expected.to contain_postgresql__server__db('puppetdb') }
       end
 
+      el10 = facts.dig(:os, 'family') == 'RedHat' && facts.dig(:os, 'release', 'major') == '10'
+
       describe 'without managed postgresql' do
         let :pre_condition do
-          <<-HEREDOC
-          class { 'postgresql::server':
-          }
-          HEREDOC
+          if el10
+            <<-HEREDOC
+            class { 'postgresql::globals':
+              version => '16',
+            }
+            -> class { 'postgresql::server': }
+            HEREDOC
+          else
+            <<-HEREDOC
+            class { 'postgresql::server':
+            }
+            HEREDOC
+          end
         end
 
         let :params do

And please ask some experienced folks about this unholy hack.

@d1nuc0m
Copy link
Copy Markdown
Contributor Author

d1nuc0m commented Apr 14, 2026

And please ask some experienced folks about this unholy hack.

Thanks, I wasn't continuing with the PR precisely because "unholy" is not enough :D

Do we prefer EL10 support now (and fixing this later) or do we want to wait for postgresql support? @bastelfreak @binford2k

@corporate-gadfly
Copy link
Copy Markdown
Contributor

@d1nuc0m : can you try pushing with the above diff and we'll see if the failing checks get fixed?

@corporate-gadfly
Copy link
Copy Markdown
Contributor

corporate-gadfly commented Apr 14, 2026

Apologies, as I committed directly to el10 branch, in order to move things forward.

I see in the logs:

Error: Execution of '/usr/bin/dnf module disable -y postgresql' returned 1: WARNING: modularity is deprecated, and functionality will be removed in a future release of DNF5.
  Last metadata expiration check: 0:00:18 ago on Tue Apr 14 22:27:42 2026.
  Unable to resolve argument postgresql
  Error: Problems in request:
  missing groups or modules: postgresql
�[00;00m�[00;33m  Error: /Stage[main]/Main/Package[disable-builtin-dnf-postgresql-module]/ensure: change from 'purged' to 'disabled' failed: Execution of '/usr/bin/dnf module disable -y postgresql' returned 1: WARNING: modularity is deprecated, and functionality will be removed in a future release of DNF5.
  Last metadata expiration check: 0:00:18 ago on Tue Apr 14 22:27:42 2026.
  Unable to resolve argument postgresql
  Error: Problems in request:
  missing groups or modules: postgresql

It seems like we are making progress, but then again who knows? So, the above error is likely related to:

# TODO: rework this hack, maybe not needed for newer version of postgresl module?
if versioncmp($facts['os']['release']['major'], '8') >= 0 {
package { 'disable-builtin-dnf-postgresql-module':
ensure => 'disabled',
name => 'postgresql',
provider => 'dnfmodule',
}
Yumrepo <| tag == 'postgresql::repo' |>
-> Package['disable-dnf-postgresql-module']
-> Package <| tag == 'postgresql' |>
}

@corporate-gadfly
Copy link
Copy Markdown
Contributor

And then later on:

�[00;00m�[00;33m  Error: Could not find command '/usr/pgsql-16/bin/initdb'
�[00;00m�[00;33m  Error: /Stage[main]/Postgresql::Server::Initdb/Postgresql::Server::Instance::Initdb[main]/Exec[postgresql_initdb_instance_main]/returns: change from 'notrun' to ['0'] failed: Could not find command '/usr/pgsql-16/bin/initdb'

@corporate-gadfly
Copy link
Copy Markdown
Contributor

I feel like I have made more progress 🤷 .

@corporate-gadfly
Copy link
Copy Markdown
Contributor

corporate-gadfly commented Apr 15, 2026

Make more progress. Looks like postgresql is now being installed in the acceptance test, at least initially.

I will try to see how to make it not fail initially and then make it idempotent.

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.

@corporate-gadfly
Copy link
Copy Markdown
Contributor

@d1nuc0m I apologize again for committing directly to your branch (the GitHub UI allowed me to edit files in-place and was the easiest thing for me to try).

In any case, all the unit and acceptance tests are passing now. I learned a lot about acceptance tests, for sure.

@corporate-gadfly
Copy link
Copy Markdown
Contributor

@d1nuc0m : Could you also explain the motivation behind the following deviations from EL8/9?

  • Not managing the package repo? This is the only way to get modern PGDG repo.
  • Use of non-standard paths?
    • datadir
    • confdir
    • service_name

I would suggest rebasing the multiple commits into single commit, force pushing and then try out any extra modifications that you may deem necessary.

@d1nuc0m
Copy link
Copy Markdown
Contributor Author

d1nuc0m commented Apr 16, 2026

@corporate-gadfly thank you for all the contributions, I had to pause this for other committments. I used "non standard" paths + not managing the repo as I was trying to make it work with the PostgreSQL version/packages in default EL10 repositories

@d1nuc0m d1nuc0m changed the title WIP/DRAFT feat: add EL10 support feat: add EL10 support Apr 17, 2026
Comment thread data/common.yaml Outdated
Comment thread manifests/database/postgresql.pp Outdated
Comment thread hiera.yaml Outdated
Comment thread hiera.yaml
@d1nuc0m d1nuc0m force-pushed the el10 branch 5 times, most recently from 327db5b to 1bdc18f Compare April 17, 2026 10:47
@d1nuc0m
Copy link
Copy Markdown
Contributor Author

d1nuc0m commented Apr 17, 2026

Tried to set variables but now it's broken on EL9 due to dnf...

Comment thread manifests/database/postgresql.pp Outdated
Comment thread spec/support/acceptance/shared/puppetserver.pp
@d1nuc0m d1nuc0m force-pushed the el10 branch 3 times, most recently from 86721cd to 4b8c659 Compare April 17, 2026 12:47
Add an "unholy hack" (quote) to support EL10 while it's added to postgresql

Co-authored-by: Corporate Gadfly <corporate-gadfly@users.noreply.github.com>
@corporate-gadfly corporate-gadfly merged commit 12b519d into voxpupuli:main Apr 17, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants