Hi i have written this ansible with https://github/sudoix together
https://github.com/imanbakhtiari/postgres-ansible.git
This ansible needs 5 virtual machinehttps://github.com/imanbakhtiari/postgres-ansible.git
in 3 of them it install postgresql with patroni replication
and in two of them it install haproxy and keepalived
finally it became so stable idea for database with a SQL and also etcd NOSQL
with this single commandansible-playbook -i inventory/db-servers.ini postgres.yml --become --become-method=sudo --tags "preinstall,postgres,haproxy" --ask-become-pass
https://gitea.com/imanbakhtiari/resume