mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-04-24 02:20:51 +08:00
[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:
@@ -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
|
||||
|
||||
23
roles/mailman3/templates/settings_admin.py.j2
Normal file
23
roles/mailman3/templates/settings_admin.py.j2
Normal 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': '',
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user