[mailman3] Migrate initial-data.json from mailman role

This JSON file contains authentication providers set up in mailman. This change
should allow it to be used in mailman3 role.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
This commit is contained in:
Michal Konecny
2024-05-30 16:15:54 +02:00
parent 454d844a9e
commit 06ed86e690
3 changed files with 54 additions and 0 deletions

View File

@@ -45,6 +45,9 @@ mailman_login:
twitter:
display_name: Twitter
provider: twitter
fedora:
display_name: Fedora
provider: fedora
mem_size: 4096
nrpe_check_postfix_queue_crit: 50
# by default, the number of emails in queue before we whine

View File

@@ -208,6 +208,27 @@
- mailman
- hyperkitty
- name: Copy the initial user fixture
ansible.builtin.template:
src: initial-data.json.j2
dest: "{{ mailman_webui_confdir }}/initial-data.json"
owner: root
group: root
mode: 0640
tags:
- mailman
- hyperkitty
- name: Initialize authentication providers
ansible.builtin.command:
cmd: mailman-web loaddata "{{ mailman_webui_confdir }}/initial-data.json"
chdir: /etc/mailman3
become_user: mailman
become: true
tags:
- mailman
- hyperkitty
# Add the Nest banner
# See issue https://pagure.io/fedora-infrastructure/issue/10103
- name: Replace the top.html template in hyperkitty/postorius to change banner

View File

@@ -0,0 +1,30 @@
[
{% for host in mailman_domains %}
{
"fields": {
"domain": "{{ host }}",
"name": "Fedora mailing-lists"
},
"model": "sites.site",
"pk": {{ loop.index }}
},
{% endfor %}
{% for service_name, service_data in mailman_login.items() %}
{
"fields": {
"name": "{{ service_data.display_name }}",
"sites": [
{% for host in mailman_domains %}
{{ loop.index }}{% if not loop.last %},{% endif %}
{% endfor %}
],
"client_id": "{{ mailman_login_secrets[env][service_name].client_id }}",
"secret": "{{ mailman_login_secrets[env][service_name].secret }}",
"key": "",
"provider": "{{ service_data.provider }}"
},
"model": "socialaccount.socialapp",
"pk": {{ loop.index }}
}{% if not loop.last %},{% endif %}
{% endfor %}
]