geerlingguy / ansible-role-postgresql

Ansible Role - PostgreSQL
https://galaxy.ansible.com/geerlingguy/postgresql/
MIT License
572 stars 389 forks source link

Add PostgreSQL apt repo and signing key for installing specific versions of Postgres for debian based distros #251

Open Souldiv opened 1 year ago

Souldiv commented 1 year ago

Changes

Included tasks for adding PostgreSQL apt repo and signing key

Reason for changes

Certain applications have need for specific versions of postgresql. The default packages variables postgres_packages even when initialized to something like postgresql-15 and postgresql-client-15 are not recognized by apt without adding the repo. Hence, it would be helpful for debian based systems to include the repo such that we can install these packages.

Installing the default packages postgresql and postgresql-contrib installs the latest version of postgres for the particular distribution.

I have tested the above code on an Ubuntu 22.04 Live Server VM. Currently without the above changes, installing the packages via apt only installs the latest version which as of writing this PR is postgres-16. With the changes I am able to install the particular version of postgres on the server.

Please let me know if there are any further changes that I might need to make.

fixes #242

Souldiv commented 1 year ago

Looks like CI is failing because of the issue mentioned earlier.

Installing the default packages postgresql and postgresql-contrib installs the latest version of postgres for the particular distribution.

by default the var postgresql_packages holds packages that install the latest version which means that the version postgresql_version is different hence why it doesn't find the directory at check if postgresql database is initialized task tasks/initialize.yml

github-actions[bot] commented 9 months ago

This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

github-actions[bot] commented 1 week ago

This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.