Skip to content

Commit

Permalink
Add RHEL GPG key with PGDG prefix (allows installing PostgreSQL >= 11)
Browse files Browse the repository at this point in the history
According to https://download.postgresql.org/pub/repos/yum/keys/README.txt, there are two types of keys for RHEL: `RPM-GPG-KEY-PGDG*` and `PGDG-RPM-GPG-KEY*`.

> This directory contains keys used for signing the PostgreSQL RPMs on RHEL (and its derivatives) and Fedora.
> The keys which have the PGDG prefix are used to sign PostgreSQL 11 and above RPMs.
>
> Archived versions (v10 and below) use the RPM-GPG-KEY prefix.

The role is already adding the first kind of key to the system, but not the second. Therefore, installing newer PostgreSQL versions is not possible at the moment. This commit adds the second type of key so that newer PostgreSQL versions can be installed too.
  • Loading branch information
kysrpex authored Jun 20, 2024
1 parent 53bf360 commit d944281
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tasks/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@
register: __postgresql_repo_pkg_installed_result
ignore_errors: true

- name: Install repository key
- name: Install repository key (PostgreSQL v10 and below)
rpm_key:
key: https://download.postgresql.org/pub/repos/yum/keys/RPM-GPG-KEY-PGDG
state: present

- name: Install repository key (PostgreSQL v11 and above)
rpm_key:
key: https://download.postgresql.org/pub/repos/yum/keys/PGDG-RPM-GPG-KEY-RHEL
state: present

- name: Install pgdg repository package (RedHat)
yum:
name: >-
Expand Down

0 comments on commit d944281

Please sign in to comment.