ansible/roles/docker/tasks/services/mailman.yml

98 lines
3.2 KiB
YAML
Raw Permalink Normal View History

2019-03-21 08:41:45 +00:00
---
- name: copy nginx configuration to link static files
template:
src: "templates/mailman/nginx_vhost"
dest: "{{ nginx.volume_folder }}/vhost/lists.data.coop"
mode: "0644"
2019-03-21 08:41:45 +00:00
- name: run mailman server containers
docker_compose:
project_name: "mailman"
2019-03-21 08:41:45 +00:00
definition:
2021-03-04 22:32:09 +00:00
version: '3'
2019-03-21 08:41:45 +00:00
services:
2021-03-04 22:32:09 +00:00
mailman-core:
image: maxking/mailman-core:0.3.11
volumes:
- "{{ volume_root_folder }}/mailman/core:/opt/mailman"
stop_grace_period: 30s
links:
- mailman-web:mailmain-web
- database:database
depends_on:
- database
environment:
DATABASE_URL: "postgres://mailman:{{ mailman_secrets.postgres_password }}@172.19.199.4/mailmandb"
DATABASE_TYPE: "postgres"
DATABASE_CLASS: "mailman.database.postgresql.PostgreSQLDatabase"
HYPERKITTY_API_KEY: "{{ mailman_secrets.hyperkitty_api_key }}"
HYPERKITTY_URL: http://172.19.199.3:8000/hyperkitty
MTA: "postfix"
SMTP_HOST: "{{ smtp_host }}"
SMTP_PORT: "{{ smtp_port }}"
SMTP_HOST_USER: "noop"
2021-03-04 22:32:09 +00:00
MM_HOSTNAME: "172.19.199.2"
networks:
mailman:
ipv4_address: 172.19.199.2
postfix:
external_services:
mailman-web:
2021-03-04 22:32:09 +00:00
image: maxking/mailman-web:0.3.11
depends_on:
- database
links:
- database:database
volumes:
2021-03-04 22:32:09 +00:00
- "{{ volume_root_folder }}/mailman/web:/opt/mailman-web-data"
environment:
DATABASE_TYPE: "postgres"
2021-03-04 22:32:09 +00:00
DATABASE_URL: "postgres://mailman:{{ mailman_secrets.postgres_password }}@172.19.199.4/mailmandb"
HYPERKITTY_API_KEY: "{{ mailman_secrets.hyperkitty_api_key }}"
2021-03-04 22:32:09 +00:00
DJANGO_ALLOWED_HOSTS: "lists.data.coop"
SERVE_FROM_DOMAIN: "lists.data.coop"
MAILMAN_ADMIN_USER: "valberg"
MAILMAN_ADMIN_EMAIL: "valberg@orn.li"
2021-03-04 22:32:09 +00:00
MAILMAN_REST_URL: "http://172.19.199.2:8001"
SECRET_KEY: "{{ mailman_secrets.django_secret_key }}"
SMTP_HOST: "{{ smtp_host }}"
SMTP_PORT: "{{ smtp_port }}"
VIRTUAL_HOST: "lists.data.coop"
2021-03-05 08:56:51 +00:00
VIRTUAL_PORT: 8000
LETSENCRYPT_HOST: "lists.data.coop"
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
networks:
2021-03-04 22:32:09 +00:00
mailman:
ipv4_address: 172.19.199.3
postfix:
external_services:
2019-03-21 08:41:45 +00:00
database:
2021-03-04 22:32:09 +00:00
image: postgres:13
restart: always
2019-03-21 08:41:45 +00:00
environment:
POSTGRES_DB: mailmandb
POSTGRES_USER: mailman
POSTGRES_PASSWORD: "{{ mailman_secrets.postgres_password }}"
2019-03-21 08:41:45 +00:00
volumes:
2021-03-04 22:32:09 +00:00
- "{{ volume_root_folder }}/mailman/database:/var/lib/postgresql/data"
2019-03-21 08:41:45 +00:00
networks:
2021-03-04 22:32:09 +00:00
mailman:
ipv4_address: 172.19.199.4
2019-03-21 08:41:45 +00:00
networks:
mailman:
2021-03-04 22:32:09 +00:00
driver: bridge
ipam:
driver: default
config:
- subnet: 172.19.199.0/24
postfix:
external: true
external_services:
external: true