Closed dracic closed 4 years ago
Thanks @dracic! xref: https://yum.postgresql.org/repopackages.php
There is one issue more. When you install pgdg-redhat-repo, all pg version repos are enabled by default. I don't find this to be elegant solution, and think only pg version defined by postgresql_version variable should be enabled. So I did localy this workaround:
- name: Disable all pgdg repos (RedHat)
shell: yum-config-manager --disable pgdg\*
when: __postgresql_repo_pkg_installed_result is failed
- name: Enable appropriate pgdg repo (RedHat)
ini_file:
path: /etc/yum.repos.d/pgdg-redhat-all.repo
section: pgdg{{ postgresql_version }}
option: enabled
value: '1'
I'm in process of learning Ansible, so I'm not sure if this is the most elegant way to do this. If you think this is ok I will push one more commit to this PR.
Best regards Davor
Thanks @dracic! I think there's a way to do the second part with yum_repository that'd be a bit cleaner, so I'm looking in to that.
As of 15 April 2019, there is only one repository RPM per distro, and it includes repository information for all available PostgreSQL releases.