community.postgresql
community.postgresql copied to clipboard
postgresql_cluster: manage psql clusters on a host - not just main
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.
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)
Abhijit was opposed to the idea as far as I remember. I would personally avoid this feature too.
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.
thanks everyone! closing this to keep the tracker clean