♻: add pg role determination to mastodon
This commit is contained in:
15
roles/mastodon/tasks/db.yml
Normal file
15
roles/mastodon/tasks/db.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: Create mastodon db role
|
||||
become_user: postgres
|
||||
become: true
|
||||
community.postgresql.postgresql_user:
|
||||
name: "{{ mastodon_pg_role }}"
|
||||
password: "{{ mastodon_pg_password }}"
|
||||
|
||||
- name: Create mastodon db
|
||||
become_user: postgres
|
||||
become: true
|
||||
community.postgresql.postgresql_db:
|
||||
name: "{{ mastodon_pg_database }}"
|
||||
owner: "{{ mastodon_pg_role }}"
|
@@ -1,5 +1,8 @@
|
||||
---
|
||||
|
||||
- name: Init db
|
||||
ansible.builtin.include_tasks: db.yml
|
||||
|
||||
- name: Create mastodon user
|
||||
ansible.builtin.user:
|
||||
name: mastodon
|
||||
@@ -63,5 +66,15 @@
|
||||
- name: Install mastodon
|
||||
ansible.builtin.include_tasks: mastodon.yml
|
||||
|
||||
- name: Put env file
|
||||
ansible.builtin.template:
|
||||
src: "env.production.j2"
|
||||
dest: "{{ mastodon_home }}/live/.env.production"
|
||||
user: mastodon
|
||||
group: mastodon
|
||||
mode: "0o600"
|
||||
notify:
|
||||
- Restart mastodon
|
||||
|
||||
- name: Install tootctl cron
|
||||
ansible.builtin.include_tasks: cron.yml
|
||||
|
Reference in New Issue
Block a user