Skip to content

Commit

Permalink
enable postgresql repos
Browse files Browse the repository at this point in the history
  • Loading branch information
mtangaro committed Mar 28, 2022
1 parent 3ac783a commit 82659c7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 29 deletions.
19 changes: 19 additions & 0 deletions files/pgdg-96.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# PGDG Red Hat Enterprise Linux / CentOS stable common repository for all PostgreSQL versions

[pgdg-common]
name=PostgreSQL common RPMs for RHEL / CentOS $releasever - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
repo_gpgcheck = 0

# PGDG Red Hat Enterprise Linux / CentOS stable repositories:

[pgdg96]
name=PostgreSQL 9.6 for RHEL / CentOS $releasever - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
repo_gpgcheck = 0
33 changes: 4 additions & 29 deletions tasks/postgresql_redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,10 @@
- { section: 'base', option: 'exclude', value: 'postgresql*' }
- { section: 'updates', option: 'exclude', value: 'postgresql*' }

- name: '[EL] Install repository'
yum:
name: '{{ postgresql_yum_repository_url }}'
state: present

# This workaround has to be removed with ansible update
- name: '[EL] Temporary disable pgdg repository for postgresql > 9.6'
ini_file:
dest: /etc/yum.repos.d/pgdg-redhat-all.repo
section: '{{ item }}'
option: enabled
value: 0
with_items:
- pgdg14
- pgdg13
- pgdg12
- pgdg11
- pgdg10

# This workaround has to be removed with ansible update
- name: '[EL] Temporary disable GPG check for pgdc repository'
ini_file:
dest: /etc/yum.repos.d/pgdg-redhat-all.repo
section: '{{ item }}'
option: repo_gpgcheck
value: 0
with_items:
- pgdg-common
- pgdg96
- name: '[EL] Install postgresql repository'
copy:
src: 'pgdg-96.repo'
dest: '/etc/yum.repos.d/pgdg-96.repo'

- name: '[EL] Install postgresql {{ postgresql_version }}'
yum:
Expand Down

0 comments on commit 82659c7

Please sign in to comment.