mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-15 16:40:45 +02:00
Optimized handlers order for mailu
This commit is contained in:
parent
a9d77de2a4
commit
5426014096
@ -10,10 +10,10 @@
|
|||||||
- "{{ DOCKER_VARS_FILE }}" # Important to load docker variables first so that database can use them
|
- "{{ DOCKER_VARS_FILE }}" # Important to load docker variables first so that database can use them
|
||||||
- "{{ cmp_db_docker_vars_file_db }}" # Important to load them before docker role so that backup can use them
|
- "{{ cmp_db_docker_vars_file_db }}" # Important to load them before docker role so that backup can use them
|
||||||
|
|
||||||
- name: "For '{{ application_id }}': Load cmp-docker-oauth2"
|
|
||||||
include_role:
|
|
||||||
name: cmp-docker-oauth2
|
|
||||||
|
|
||||||
- name: "For '{{ application_id }}': Load central RDBMS"
|
- name: "For '{{ application_id }}': Load central RDBMS"
|
||||||
include_role:
|
include_role:
|
||||||
name: cmp-rdbms
|
name: cmp-rdbms
|
||||||
|
|
||||||
|
- name: "For '{{ application_id }}': Load cmp-docker-oauth2"
|
||||||
|
include_role:
|
||||||
|
name: cmp-docker-oauth2
|
@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
# The following env file will just be used from the dedicated mariadb container
|
# The following env file will just be used from the dedicated mariadb container
|
||||||
# and not the central one
|
# and not the central one
|
||||||
|
- block:
|
||||||
|
- name: "Ensure env dir exists: {{ docker_compose.directories.env }}"
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ docker_compose.directories.env }}"
|
||||||
|
state: directory
|
||||||
|
mode: "0755"
|
||||||
- name: "For '{{ application_id }}': Create {{database_env}}"
|
- name: "For '{{ application_id }}': Create {{database_env}}"
|
||||||
template:
|
template:
|
||||||
src: "env/{{database_type}}.env.j2"
|
src: "env/{{database_type}}.env.j2"
|
||||||
|
@ -23,5 +23,5 @@
|
|||||||
when: "'mail-bot' in item.value.roles or 'administrator' in item.value.roles"
|
when: "'mail-bot' in item.value.roles or 'administrator' in item.value.roles"
|
||||||
|
|
||||||
- name: "Create Mailu API Token for {{ mailu_user_name }}"
|
- name: "Create Mailu API Token for {{ mailu_user_name }}"
|
||||||
include_tasks: create-mailu-token.yml
|
include_tasks: 01_0A_create-mailu-token.yml
|
||||||
when: "{{ 'mail-bot' in item.value.roles }}"
|
when: "{{ 'mail-bot' in item.value.roles }}"
|
@ -2,7 +2,7 @@
|
|||||||
include_vars: vars/mailu-dns.yml
|
include_vars: vars/mailu-dns.yml
|
||||||
|
|
||||||
- name: Generate DKIM public key
|
- name: Generate DKIM public key
|
||||||
include_tasks: generate-and-read-dkim.yml
|
include_tasks: 02_0A_generate-and-read-dkim.yml
|
||||||
|
|
||||||
- name: "Set A record for mail server"
|
- name: "Set A record for mail server"
|
||||||
community.general.cloudflare_dns:
|
community.general.cloudflare_dns:
|
@ -1,20 +1,18 @@
|
|||||||
---
|
---
|
||||||
|
- block:
|
||||||
- name: "load docker, db and proxy for {{application_id}}"
|
- name: "load docker, db and proxy for {{application_id}}"
|
||||||
include_role:
|
include_role:
|
||||||
name: cmp-db-docker-proxy
|
name: cmp-db-docker-proxy
|
||||||
when: run_once_web_app_mailu is not defined
|
|
||||||
|
|
||||||
- name: "Include the srv-proxy-6-6-tls-deploy role"
|
- name: "Include the srv-proxy-6-6-tls-deploy role"
|
||||||
include_role:
|
include_role:
|
||||||
name: srv-proxy-6-6-tls-deploy
|
name: srv-proxy-6-6-tls-deploy
|
||||||
when: run_once_web_app_mailu is not defined
|
|
||||||
|
|
||||||
- name: Flush docker service handlers
|
- name: Flush docker service handlers
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
when: run_once_web_app_mailu is not defined
|
|
||||||
|
|
||||||
- name: "Create Mailu accounts"
|
- name: "Create Mailu accounts"
|
||||||
include_tasks: create-mailu-user.yml
|
include_tasks: 01_00_create-mailu-user.yml
|
||||||
vars:
|
vars:
|
||||||
mailu_compose_dir: "{{ docker_compose.directories.instance }}"
|
mailu_compose_dir: "{{ docker_compose.directories.instance }}"
|
||||||
mailu_domain: "{{ primary_domain }}"
|
mailu_domain: "{{ primary_domain }}"
|
||||||
@ -34,13 +32,10 @@
|
|||||||
loop: "{{ users | dict2items }}"
|
loop: "{{ users | dict2items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: item
|
loop_var: item
|
||||||
when: run_once_web_app_mailu is not defined
|
|
||||||
|
|
||||||
- name: Set Mailu DNS records
|
- name: Set Mailu DNS records
|
||||||
include_tasks: set-mailu-dns-records.yml
|
include_tasks: 02_00_set-mailu-dns-records.yml
|
||||||
when: dns_provider == 'cloudflare'
|
when: dns_provider == 'cloudflare'
|
||||||
|
|
||||||
- name: Run the docker_mailu roles once
|
- include_tasks: utils/run_once.yml
|
||||||
set_fact:
|
|
||||||
run_once_web_app_mailu: true
|
|
||||||
when: run_once_web_app_mailu is not defined
|
when: run_once_web_app_mailu is not defined
|
@ -1,4 +1,8 @@
|
|||||||
|
# General
|
||||||
application_id: "web-app-mailu"
|
application_id: "web-app-mailu"
|
||||||
|
domain: "{{ domains | get_domain(application_id) }}"
|
||||||
|
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||||
|
proxy_extra_configuration: "client_max_body_size 31M;"
|
||||||
|
|
||||||
# Database Configuration
|
# Database Configuration
|
||||||
database_password: "{{ applications | get_app_conf(application_id, ' credentials.database_password') }}"
|
database_password: "{{ applications | get_app_conf(application_id, ' credentials.database_password') }}"
|
||||||
@ -10,9 +14,7 @@ cert_mount_directory: "{{docker_compose.directories.volumes}}certs/"
|
|||||||
# @see https://github.com/heviat/Mailu-OIDC/tree/2024.06
|
# @see https://github.com/heviat/Mailu-OIDC/tree/2024.06
|
||||||
docker_source: "{{ 'ghcr.io/heviat' if applications | get_app_conf(application_id, 'features.oidc', False) else 'ghcr.io/mailu' }}"
|
docker_source: "{{ 'ghcr.io/heviat' if applications | get_app_conf(application_id, 'features.oidc', False) else 'ghcr.io/mailu' }}"
|
||||||
|
|
||||||
domain: "{{ domains | get_domain(application_id) }}"
|
# Mailu Specific
|
||||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
|
||||||
proxy_extra_configuration: "client_max_body_size 31M;"
|
|
||||||
mailu_version: "{{ applications | get_app_conf(application_id, 'docker.services.mailu.version', True) }}"
|
mailu_version: "{{ applications | get_app_conf(application_id, 'docker.services.mailu.version', True) }}"
|
||||||
mailu_name: "{{ applications | get_app_conf(application_id, 'docker.services.mailu.name', True) }}"
|
mailu_name: "{{ applications | get_app_conf(application_id, 'docker.services.mailu.name', True) }}"
|
||||||
mailu_smtp_queue: "mailu_smtp_queue"
|
mailu_smtp_queue: "mailu_smtp_queue"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user