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:
parent
08fd4dc970
commit
7c8d869f7c
4
roles/group_vars/all.sample
Normal file
4
roles/group_vars/all.sample
Normal 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:
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user