mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-20 03:57:02 +08:00
[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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
30
roles/mailman3/templates/initial-data.json.j2
Normal file
30
roles/mailman3/templates/initial-data.json.j2
Normal 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 %}
|
||||
]
|
||||
Reference in New Issue
Block a user