Switch over to using a variable for database name

Also addition to PostgreSQL role to drop any existing database with the same name to allow for playbook reruns.
This commit is contained in:
staticsafe 2017-11-27 12:12:42 -05:00
parent 08fd4dc970
commit 7c8d869f7c
3 changed files with 11 additions and 1 deletions

View File

@ -0,0 +1,4 @@
# Specify the PostgreSQL database name you want to use for Mastodon
# Please note that the playbook will drop this database in preparation for Mastodon's
# database setup process.
DB_NAME:

View File

@ -9,7 +9,7 @@ DB_HOST=/var/run/postgresql
# Your PostgreSQL user
DB_USER=mastodon
# Your PostgreSQL DB name
DB_NAME=mastodon_production
DB_NAME={{ DB_NAME }}
# Leave DB password empty
DB_PASS=
# Your DB_PORT

View File

@ -15,3 +15,9 @@
state: present
become: true
become_user: postgres
- name: Drop any existing database that may exist with the same name
postgresql_db:
name: {{ DB_NAME }}
state: absent
become: true
become_user: postgres