[mailman3] We need admin access to database for migrations

We didn't need that on staging, but on production the permissions are more
granular.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
This commit is contained in:
Michal Konecny
2024-06-27 13:47:20 +02:00
parent 1d562201ed
commit 08f990cf79
2 changed files with 30 additions and 2 deletions

View File

@@ -147,8 +147,11 @@
- name: Install the hyperkitty/postorius settings file
ansible.builtin.template:
src: settings.py.j2
dest: "{{ mailman_webui_confdir }}/settings.py"
src: "{{ item }}.j2"
dest: "{{ mailman_webui_confdir }}/{{ item }}"
with_items:
- settings.py
- settings_admin.py
tags:
- config
- mailman
@@ -334,6 +337,8 @@
chdir: /etc/mailman3
become_user: mailman
become: true
environment:
DJANGO_SETTINGS_MODULE = "{{ mailman_webui_confdir }}/settings_admin.py"
tags:
- mailman
- db

View File

@@ -0,0 +1,23 @@
#-*- coding: utf-8 -*-
"""
Copy of the Django settings file, but with database admin credentials (for
schema modifications)
"""
from settings import *
try:
from settings_local import *
except ImportError:
pass
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'hyperkitty',
'USER': 'hyperkittyadmin',
'PASSWORD': '{{ mailman_hyperkitty_admin_db_pass }}',
'HOST': '{{ mailman_db_server }}',
'PORT': '',
}
}