forked from ISTI-ansible-roles/ansible-roles
257 lines
8.2 KiB
YAML
257 lines
8.2 KiB
YAML
---
|
|
|
|
# TODO: make sure you point out to set django secret_key, django admins, django archive key?
|
|
|
|
mailman_install_method: pip
|
|
mailman_language: en
|
|
mailman_language_code: en-us
|
|
mailman_install_system_dependencies: "{{ __mailman_debian or __mailman_redhat }}"
|
|
mailman_python_uwsgi_package: pyuwsgi
|
|
mailman_backup_configs: false
|
|
# list of dicts with keys `name`, `email`, `pass`
|
|
mailman_django_superusers: []
|
|
# list of hosted domains
|
|
#mailman_domains: []
|
|
# If mailman_domains is set, mailman_config.default_from_email is ignored since it's assumed you want per-domain
|
|
# addresses. In this case, set the username portion of the email (the domain will be added automatically)
|
|
mailman_default_from_user: postorius
|
|
|
|
# Distribute Postfix maps to MXs for use with relay_recipient_maps, so that MXs can reject mail to nonexistent
|
|
# addresses. Installs Ansible and a playbook in a virtualenv. User/auth setup is up to you.
|
|
#
|
|
# list of dicts, required keys:
|
|
# host: inventory_hostname of mx (or "all") for vars to apply to all hosts
|
|
# mailman_distribute_maps_dir: remote directory on mx to distribute maps to
|
|
# all keys other than "host" are set as either host vars or in [all:vars] if host = "all"
|
|
#mailman_distribute_maps: []
|
|
mailman_distribute_maps_dir: "{{ mailman_var_dir }}/distribute_maps"
|
|
|
|
# For pip installs, the role creates a venv at this path
|
|
mailman_install_dir: /opt/mailman
|
|
|
|
# uWSGI/proxy communication socket (value only used for pip installs, Debian uses a hardcoded default)
|
|
mailman_uwsgi_socket: "{{ mailman_django_var_dir }}/run/uwsgi.sock"
|
|
|
|
# Optionally serve directly with uWSGI
|
|
#mailman_http_socket:
|
|
mailman_uwsgi_static: no
|
|
|
|
# You should rarely need to set these
|
|
#mailman_virtualenv_python: python3
|
|
#mailman_virtualenv_command: python3 -m venv # https://github.com/ansible/ansible/issues/52275
|
|
mailman_virtualenv_command: pyvenv
|
|
|
|
__mailman_debian: "{{ ansible_os_family == 'Debian' }}"
|
|
__mailman_redhat: "{{ ansible_os_family == 'RedHat' }}"
|
|
__mailman_pip: "{{ mailman_install_method == 'pip' }}"
|
|
|
|
# pip needed packages if using the pip install method, system packages if using the package method
|
|
__mailman_pip_packages:
|
|
- whoosh
|
|
- django>=1.11
|
|
- mailman
|
|
- postorius
|
|
- hyperkitty
|
|
- mailman-hyperkitty
|
|
- "{{ mailman_python_uwsgi_package }}"
|
|
__mailman_debian_packages:
|
|
- mailman-full
|
|
__mailman_redhat_packages: null # currently nonexistent
|
|
mailman_packages: >-
|
|
{{
|
|
__mailman_pip_packages if __mailman_pip else (
|
|
__mailman_debian_packages if __mailman_debian else
|
|
__mailman_redhat_packages)
|
|
}}
|
|
# for e.g. psycopg2
|
|
mailman_extra_packages: []
|
|
|
|
# Dependant system packages needed if using the pip install method
|
|
__mailman_debian_system_dependency_packages:
|
|
- python3 # requires Ubuntu >= 16.04, Debian >= stretch (for 3.5)
|
|
- python3-setuptools # Ansible pip module needs this despite having venv; UPDATE: no it doesn't if it can find python3; UPDATE2: well now it does again, wtf
|
|
- python3-venv
|
|
- sassc
|
|
- uwsgi
|
|
- uwsgi-plugin-python3
|
|
__mailman_redhat_system_dependency_packages:
|
|
# all require EPEL
|
|
- python36 # requires EL7+
|
|
- sassc
|
|
- uwsgi
|
|
- uwsgi-plugin-python36
|
|
# TODO: as of `date`, compilers + python headers are required for these packages that don't have published cext wheels:
|
|
# - rcssmin
|
|
# - rjsmin
|
|
# But this role will not install compilers in case wheels become available at a later date
|
|
mailman_system_dependency_packages: >-
|
|
{{
|
|
__mailman_debian_system_dependency_packages if __mailman_debian else
|
|
__mailman_redhat_system_dependency_packages
|
|
}}
|
|
|
|
# TODO: supervisor
|
|
mailman_process_manager: >-
|
|
{{
|
|
'systemd' if ansible_virtualization_type != 'docker' else None
|
|
}}
|
|
|
|
mailman_core_service_name: >-
|
|
{{
|
|
'mailman-core' if __mailman_pip else (
|
|
'mailman' if __mailman_debian else
|
|
None)
|
|
}}
|
|
|
|
mailman_web_service_name: >-
|
|
{{
|
|
'mailman-web' if __mailman_pip else (
|
|
'mailman-web' if __mailman_debian else
|
|
None)
|
|
}}
|
|
|
|
mailman_etc_dir: >-
|
|
{{
|
|
'/opt/mailman/var/etc' if __mailman_pip else (
|
|
'/etc/mailman' if __mailman_debian else
|
|
None)
|
|
}}
|
|
|
|
mailman_var_dir: >-
|
|
{{
|
|
'/opt/mailman/var' if __mailman_pip else (
|
|
'/var/lib/mailman' if __mailman_debian else
|
|
None)
|
|
}}
|
|
|
|
mailman_log_dir: >-
|
|
{{
|
|
'/opt/mailman/var/log' if __mailman_pip else (
|
|
'/var/log/mailman' if __mailman_debian else
|
|
None)
|
|
}}
|
|
|
|
mailman_django_var_dir: >-
|
|
{{
|
|
'/var/opt/mailman/web' if __mailman_pip else (
|
|
'/var/lib/mailman' if __mailman_debian else
|
|
None)
|
|
}}
|
|
|
|
mailman_django_project_dir: >-
|
|
{{
|
|
'/var/opt/mailman/web/project' if __mailman_pip else (
|
|
'/usr/share/mailman-web' if __mailman_debian else
|
|
None)
|
|
}}
|
|
|
|
mailman_django_static_dir: >-
|
|
{{
|
|
'/var/opt/mailman/web/static' if __mailman_pip else (
|
|
'/var/lib/mailman/web/static' if __mailman_debian else
|
|
None)
|
|
}}
|
|
|
|
mailman_django_log_dir: >-
|
|
{{
|
|
'/var/opt/mailman/web/log' if __mailman_pip else (
|
|
'/var/log/mailman/web' if __mailman_debian else
|
|
None)
|
|
}}
|
|
|
|
mailman_django_settings_file: >-
|
|
{{
|
|
'/opt/mailman/django-settings.py' if __mailman_pip else (
|
|
'/etc/mailman/mailman-web.py' if __mailman_debian else
|
|
None)
|
|
}}
|
|
|
|
mailman_web_user: >-
|
|
{{
|
|
'www-data' if __mailman_debian else (
|
|
None)
|
|
}}
|
|
# TODO:
|
|
#'httpd' if __mailman_redhat and apache
|
|
#'nginx' if __mailman_redhat and nginx
|
|
|
|
mailman_web_group: >-
|
|
{{
|
|
'www-data' if __mailman_debian else (
|
|
None)
|
|
}}
|
|
|
|
mailman_core_api_hostname: localhost
|
|
mailman_core_api_port: 8001
|
|
mailman_core_api_admin_user: restadmin
|
|
mailman_core_api_admin_pass: restpass
|
|
mailman_archiver_key: SecretArchiverAPIKey
|
|
|
|
__mailman_config_default:
|
|
mailman:
|
|
layout: custom
|
|
paths.custom:
|
|
var_dir: "{{ mailman_var_dir }}"
|
|
bin_dir: "$argv"
|
|
log_dir: "{{ mailman_log_dir }}"
|
|
lock_dir: "{{ mailman_var_dir }}/locks"
|
|
data_dir: "{{ mailman_var_dir }}/data"
|
|
cache_dir: "{{ mailman_var_dir }}/cache"
|
|
etc_dir: "{{ mailman_etc_dir }}"
|
|
messages_dir: "{{ mailman_var_dir }}/messages"
|
|
archives_dir: "{{ mailman_var_dir }}/archives"
|
|
template_dir: "{{ mailman_var_dir }}/templates"
|
|
pid_file: "{{ mailman_var_dir }}/master.pid"
|
|
lock_file: "{{ mailman_var_dir }}/master.lck"
|
|
webservice:
|
|
hostname: "{{ mailman_core_api_hostname }}"
|
|
port: "{{ mailman_core_api_port }}"
|
|
use_https: "no"
|
|
admin_user: "{{ mailman_core_api_admin_user }}"
|
|
admin_pass: "{{ mailman_core_api_admin_pass }}"
|
|
api_version: "3.1"
|
|
archiver.hyperkitty:
|
|
class: mailman_hyperkitty.Archiver
|
|
enable: "yes"
|
|
configuration: "{{ mailman_etc_dir }}/hyperkitty.cfg"
|
|
__mailman_config_merged: "{{ __mailman_config_default | combine(mailman_config | default({}), recursive=True) }}"
|
|
|
|
__mailman_django_config_default:
|
|
admins: "{{ mailman_django_superusers }}"
|
|
allowed_hosts: "{{ mailman_domains | default([inventory_hostname]) }}"
|
|
rest_api_url: "http://{{ mailman_core_api_hostname }}:{{ mailman_core_api_port }}"
|
|
rest_api_user: "{{ mailman_core_api_admin_user }}"
|
|
rest_api_pass: "{{ mailman_core_api_admin_pass }}"
|
|
archiver_key: "{{ mailman_archiver_key }}"
|
|
databases:
|
|
default:
|
|
ENGINE: django.db.backends.sqlite3
|
|
NAME: "{{ mailman_django_var_dir }}/db/mailmansuite.db"
|
|
USER: ''
|
|
PASSWORD: ''
|
|
HOST: ''
|
|
PORT: ''
|
|
# Disable by default, recommended Django setup for nginx passes Host, not X-Forwarded-Host
|
|
#use_x_forwarded_host: true
|
|
secure_proxy_ssl_header: HTTP_X_FORWARDED_PROTO
|
|
default_http_protocol: https
|
|
default_from_email: postorius@{{ inventory_hostname }}
|
|
server_email: root@{{ inventory_hostname }}
|
|
compress_offline: true
|
|
socialaccount_providers: {}
|
|
__mailman_django_config_merged: "{{ __mailman_django_config_default | combine(mailman_django_config | default({}), recursive=True) }}"
|
|
|
|
mailman_postorius_root: 'postorius/'
|
|
mailman_hyperkitty_root: 'hyperkitty/'
|
|
|
|
#mailman_user: mailman
|
|
mailman_create_user: "{{ __mailman_pip and not __mailman_debian }}"
|
|
|
|
__mailman_debian_user_name: list
|
|
__mailman_user_name: >-
|
|
{{
|
|
(mailman_user | default({})).name | default(
|
|
__mailman_debian_user_name if __mailman_debian else
|
|
'mailman')
|
|
}}
|