planetary-social / ansible-scripts

Ansible automation scripts used at Planetary
MIT License
2 stars 3 forks source link

Create playbook for setting up new server with a managed, external database #77

Open cooldracula opened 5 months ago

cooldracula commented 5 months ago

We want to setup an easy pattern for seperating our application from its state, so that all deployed services do not have their database and state on the same server.

This play should create a new digitalocean droplet and a digitalocean db running postgres. The db should only allow connections from the droplet. The inventory file for this host should know how to connect to the db...which means we need to retrieve the connection string and store it as a vault variable as part of the creation of the server.

We should be able to create new droplets without DB's, for those applications with no state. So the creation of the db should be behind a variable flag.

cooldracula commented 3 months ago

I added a toy example in this pr: https://github.com/planetary-social/ansible-scripts/pull/92. it is not complete, with reasoning given in the body of the pr, but hopefully a useful starting example.