Update roles/mailarchiver_db/tasks/main.yml

This commit is contained in:
2026-01-29 13:54:04 +01:00
parent 9979c3bc69
commit f1767c2112

View File

@@ -1,10 +1,18 @@
- name: Ensure PostgreSQL service is running
service:
name: postgresql
state: started
enabled: yes
- name: Create db user
become: true
become_user: postgres
postgresql_user:
name: mailuser
password: "{{ mailuser_password }}"
- name: Create database
become: true
become_user: postgres
postgresql_db:
name: mailarchiver
@@ -17,4 +25,4 @@
query: |
GRANT ALL ON SCHEMA public TO mailuser;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT ALL ON TABLES TO mailuser;
GRANT ALL ON TABLES TO mailuser;