Files
rick-infra/roles/authentik/tasks/database.yml

28 lines
691 B
YAML

---
# Authentik Database Management - Self-Contained Database Setup
- name: Create Authentik database user
postgresql_user:
name: "{{ authentik_db_user }}"
password: "{{ authentik_db_password }}"
encrypted: yes
become: yes
become_user: postgres
- name: Create Authentik database
postgresql_db:
name: "{{ authentik_db_name }}"
owner: "{{ authentik_db_user }}"
encoding: UTF8
template: template0
become: yes
become_user: postgres
- name: Grant all privileges on Authentik database to user
postgresql_privs:
db: "{{ authentik_db_name }}"
privs: ALL
type: database
role: "{{ authentik_db_user }}"
become: yes
become_user: postgres