community.postgresql icon indicating copy to clipboard operation
community.postgresql copied to clipboard

postgresql_cluster: manage psql clusters on a host - not just main

Open Andersson007 opened this issue 5 years ago • 3 comments

Copied from https://github.com/ansible-collections/community.general/issues/122 Initially reported by @Andersson007

Copied from https://github.com/ansible/ansible/issues/67125 Initially reported by @DEvil0000

Before starting this, please read the discussion in the initial issue

SUMMARY

ansible allows to manage databases and so on for postgresql but misses management of clusters. PSQL comes with tools to manage this: pg_lsclusters, pg_createcluster and so on. There should be a postgresql_cluster to do so.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

postgresql

ADDITIONAL INFORMATION

You could have more then one cluster with different DB versions or extensions installed. This makes sense for production and especially for migration scenarios. PSQL comes with tools to manage this: pg_lsclusters, pg_createcluster and so on.

Andersson007 avatar Oct 26 '20 10:10 Andersson007

while postgresql-common is very useful (provide pg_lscluster, pg_virtualenv and so on) it is often installed only in debian family distributions.

It can be installed on RH but it usually is not.

I am unsure porting postgresql-common to a module level is of interest but the features behind, which can be based on postgresql-common if present or just apply the expected policy on RH when creating new clusters. Also note that pg_ctlcluster was used to manage the service and was ok even with init.d/services, but it's not ok with systemd units (it's better to start/stop with systemctl than pg_ctlcluster)

klando avatar Oct 24 '21 20:10 klando

Abhijit was opposed to the idea as far as I remember. I would personally avoid this feature too.

Andersson007 avatar Oct 25 '21 07:10 Andersson007

ok, we agree on the mapping between existing tools and a module. The needs for better cluster management might be of interest, I'm sure the point will raise as soon as replication setup will enter the dance, and it will enter soon.

klando avatar Oct 25 '21 07:10 klando

thanks everyone! closing this to keep the tracker clean

Andersson007 avatar Jun 09 '23 11:06 Andersson007