Skip to content

Conversation

@fila43
Copy link
Collaborator

@fila43 fila43 commented Jan 26, 2026

Enhancement: Add support for postgresql 18

Issue Tracker Tickets (Jira or BZ if any): RHEL-136892

Summary by Sourcery

Add PostgreSQL 18 as a supported version in the role and related messaging.

Enhancements:

  • Extend supported PostgreSQL versions for RHEL 9 and RHEL 10 variables to include version 18.
  • Update validation error messaging to mention PostgreSQL 18 as supported on RHEL 9.

Documentation:

  • Document PostgreSQL 18 as a supported server version and valid value for postgresql_version.

@fila43 fila43 requested review from richm and spetrosi as code owners January 26, 2026 09:03
@sourcery-ai
Copy link

sourcery-ai bot commented Jan 26, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds PostgreSQL 18 support to the Ansible role by updating supported version lists, OS-specific version matrices, and user-facing documentation/messages for RHEL 9 and 10.

Flow diagram for PostgreSQL version validation with added 18 support

flowchart TD
  A[User sets variable postgresql_version] --> B[Gather ansible_facts]
  B --> C{distribution_major_version}

  C --> D[RHEL8]
  C --> E[RHEL9]
  C --> F[RHEL10]

  D --> G{postgresql_version in __postgresql_versions_el8 10,12,13,15,16}
  G -->|yes| H[Proceed with role execution]
  G -->|no| I[Fail: unsupported PostgreSQL version for RHEL8]

  E --> J{postgresql_version in __postgresql_versions_el9 13,15,16,18}
  J -->|yes| H
  J -->|no| K[Fail: RHEL 9 supports only Postgresql 13,15,16,18]

  F --> L{postgresql_version in __postgresql_versions_el10 16,18}
  L -->|yes| H
  L -->|no| M[Fail: unsupported PostgreSQL version for RHEL10]
Loading

File-Level Changes

Change Details Files
Extend documented and configurable PostgreSQL versions to include 18.
  • Update README support statement to list PostgreSQL 18 among supported versions.
  • Update README description of the postgresql_version variable to allow 18 as a valid value.
README.md
Update internal version matrices to support PostgreSQL 18 on RHEL 9 and RHEL 10.
  • Extend __postgresql_versions_el9 to include version 18.
  • Extend __postgresql_versions_el10 to include version 18.
vars/main.yml
Align runtime validation error message with new PostgreSQL 18 support on RHEL 9.
  • Change RHEL 9 validation failure message to mention PostgreSQL 18 as supported.
tasks/main.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • The README now claims the role supports PostgreSQL 18 generally, but __postgresql_versions_el8 does not include "18", so either add 18 to the EL8 versions or clarify in the README that 18 support is limited to specific RHEL versions.
  • The hard-coded error message for RHEL 9 supported versions in tasks/main.yml should ideally be derived from the __postgresql_versions_el9 variable or otherwise kept in one place to avoid future drift when supported versions change.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The README now claims the role supports PostgreSQL 18 generally, but `__postgresql_versions_el8` does not include "18", so either add 18 to the EL8 versions or clarify in the README that 18 support is limited to specific RHEL versions.
- The hard-coded error message for RHEL 9 supported versions in `tasks/main.yml` should ideally be derived from the `__postgresql_versions_el9` variable or otherwise kept in one place to avoid future drift when supported versions change.

## Individual Comments

### Comment 1
<location> `tasks/main.yml:21` </location>
<code_context>
 - name: Check if requested version is supported in system (RHEL9)
   fail:
-    msg: RHEL 9 supports only Postgresql 13, 15 and 16
+    msg: RHEL 9 supports only Postgresql 13, 15, 16 and 18
   when:
     - ansible_facts["os_family"] == "RedHat"
</code_context>

<issue_to_address>
**suggestion:** Avoid hardcoding version list in the error message; derive it from the RHEL9 versions variable to keep them in sync.

Because `__postgresql_versions_el9` already defines the supported versions (13, 15, 16, 18), this message now duplicates that list. To avoid future drift, generate the message dynamically from `__postgresql_versions_el9` (e.g., via `join`/`map`) so it always reflects the configured supported versions.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

- name: Check if requested version is supported in system (RHEL9)
fail:
msg: RHEL 9 supports only Postgresql 13, 15 and 16
msg: RHEL 9 supports only Postgresql 13, 15, 16 and 18
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Avoid hardcoding version list in the error message; derive it from the RHEL9 versions variable to keep them in sync.

Because __postgresql_versions_el9 already defines the supported versions (13, 15, 16, 18), this message now duplicates that list. To avoid future drift, generate the message dynamically from __postgresql_versions_el9 (e.g., via join/map) so it always reflects the configured supported versions.

@richm richm changed the title fix: Add support for postgresql 18 feat: Add support for postgresql 18 Jan 26, 2026
@richm
Copy link
Contributor

richm commented Jan 26, 2026

@fila43 package or module name changed?

TASK [linux-system-roles.postgresql : Ensure required packages are installed] ***
task path: /home/rmeggins/linux-system-roles/postgresql/tests/roles/linux-system-roles.postgresql/tasks/main.yml:49
Monday 26 January 2026  08:33:50 -0700 (0:00:00.012)       0:00:42.456 ******** 
[ERROR]: Task failed: Module failed: No group postgresql:18/server available.

@fila43
Copy link
Collaborator Author

fila43 commented Jan 27, 2026

@fila43 package or module name changed?

TASK [linux-system-roles.postgresql : Ensure required packages are installed] ***
task path: /home/rmeggins/linux-system-roles/postgresql/tests/roles/linux-system-roles.postgresql/tasks/main.yml:49
Monday 26 January 2026  08:33:50 -0700 (0:00:00.012)       0:00:42.456 ******** 
[ERROR]: Task failed: Module failed: No group postgresql:18/server available.

We realized there was an issue, and the component is missing from the c9s compose. We are working on it

@fila43
Copy link
Collaborator Author

fila43 commented Jan 28, 2026

@richm now it should be fixed

@richm
Copy link
Contributor

richm commented Jan 28, 2026

[citest]

@richm
Copy link
Contributor

richm commented Jan 28, 2026

@richm now it should be fixed

Are we still waiting for a fix for CentOS 10?

{{ ['@postgresql:' + postgresql_version +
'/server'] if postgresql_version != '16' else
['postgresql-server'] }}
{{ ['@postgresql' + postgresql_version +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fila43
Now failing because @postgresql16-server is not found - do we need to have logic that uses @postgresql:N/server for N < 18, and @postgresqlN-server for N >= 18?

{{ ['@postgresql:' + postgresql_version +
'/server'] if postgresql_version != '16' else
['postgresql-server'] }}
{{ ['@postgresql' + postgresql_version +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{ ['@postgresql' + postgresql_version +
{{ ['postgresql' + postgresql_version +

looks like it isn't a group/module anymore, it's just a regular package?

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.

2 participants