Files
PostgreSQL-Ansible/roles/mailarchiver_db/tasks/main.yml
2026-01-29 12:55:01 +01:00

21 lines
474 B
YAML

- name: Create db user
become_user: postgres
postgresql_user:
name: mailuser
password: "{{ mailuser_password }}"
- name: Create database
become_user: postgres
postgresql_db:
name: mailarchiver
owner: mailuser
- name: Grant schema rights
become_user: postgres
postgresql_query:
db: mailarchiver
query: |
GRANT ALL ON SCHEMA public TO mailuser;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT ALL ON TABLES TO mailuser;