How to run a SQL Script Against a Postgres Database Using Ansible
The source code for this post can be found on GitHub.
Managing a live database, and in particular dealing with database migrations without allowing for any downtime in your application, is typically the most challenging part of any automated deployment strategy. Services can be spun up and down with impunity because their state at the beginning and at the end are exactly the same, but databases store data–their state is always changing.