I was wondering if there is a better way to deploy changes to several Postgres databases on multiple servers. I have been using Ansible for this task, I have a playbook that basically copies the changes to the server, applies them to the databases, and collect the logs using psql
:
psql -v ON_ERROR_STOP=1 -f my_changes.sql > log.out 2> log.err
But I have some problems with this approach with the INDEX
creations. Sometimes it takes several minutes or hours to create the index and I need to use background jobs with ansible using async & poll to allow Ansible run long tasks wihtout close the ssh connection. Also, I think I am using Ansible wrong since it is a configuration tool and this kind of task always reflect a change on the server...
Hoping you guys can tell me better approaches, tools( I heard that pgbarman can also deploy changes) or improvements on my current solution
1 Answer 1
I did a search for
apply schema changes to multiple PostgreSQL databases
...and in the results I found this little gem:
A possible candidate for your situation.
Disclaimer
I in no way endorse the product, nor am I in any way related to the software vendor