infra/roles/authentik/tasks/postgres.yml

25 lines
693 B
YAML
Raw Permalink Normal View History

2024-02-04 00:16:58 +00:00
- name: create db in postgres
community.postgresql.postgresql_db:
name: authentik
- name: create postgres authentik user
community.postgresql.postgresql_user:
name: authentik
db: authentik
password: "{{ lookup('ansible.builtin.password', 'secrets/' + inventory_hostname + '/authentik-pg-password.txt', length=15) }}"
- name: grant postgres authentik user permissions
community.postgresql.postgresql_privs:
database: authentik
role: authentik
type: database
privs: all
- name: grant postgres authentik user permissions
community.postgresql.postgresql_privs:
database: authentik
role: authentik
type: schema
objs: public
privs: all