Optimized handler flushing

This commit is contained in:
Kevin Veen-Birkenbach 2025-08-13 18:17:05 +02:00
parent e2014b9b59
commit 004507e233
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
12 changed files with 45 additions and 51 deletions

View File

@ -1,8 +1,4 @@
--- ---
- name: "For '{{ application_id }}': load docker and db"
include_role:
name: cmp-db-docker
- name: "For '{{ application_id }}': include role to receive certs & do modification routines" - name: "For '{{ application_id }}': include role to receive certs & do modification routines"
include_role: include_role:
name: srv-web-7-6-composer name: srv-web-7-6-composer
@ -13,6 +9,12 @@
- "{{ domains | get_domain('web-app-mailu') }}" - "{{ domains | get_domain('web-app-mailu') }}"
- "{{ domain }}" - "{{ domain }}"
- name: "For '{{ application_id }}': load docker and db"
include_role:
name: cmp-db-docker
vars:
docker_compose_flush_handlers: true
- name: "For '{{ application_id }}': configure {{domains | get_domain(application_id)}}.conf" - name: "For '{{ application_id }}': configure {{domains | get_domain(application_id)}}.conf"
template: template:
src: roles/srv-proxy-7-4-core/templates/vhost/basic.conf.j2 src: roles/srv-proxy-7-4-core/templates/vhost/basic.conf.j2

View File

@ -1,6 +1,3 @@
- name: flush docker service
meta: flush_handlers
- name: "Execute migration for '{{ application_id }}'" - name: "Execute migration for '{{ application_id }}'"
command: command:
cmd: "docker-compose run --rm web bundle exec rails db:migrate" cmd: "docker-compose run --rm web bundle exec rails db:migrate"

View File

@ -1,8 +1,4 @@
--- ---
- name: "load docker and db for {{application_id}}"
include_role:
name: cmp-db-docker
- name: "Include setup for domain '{{ domain }}'" - name: "Include setup for domain '{{ domain }}'"
include_role: include_role:
name: srv-proxy-6-6-domain name: srv-proxy-6-6-domain
@ -16,6 +12,12 @@
client_max_body_size: "80m" client_max_body_size: "80m"
vhost_flavour: "ws_generic" vhost_flavour: "ws_generic"
- name: "load docker and db for {{application_id}}"
include_role:
name: cmp-db-docker
vars:
docker_compose_flush_handlers: true
- name: "start setup procedures for mastodon" - name: "start setup procedures for mastodon"
include_tasks: 01_setup.yml include_tasks: 01_setup.yml
when: mastodon_setup | bool when: mastodon_setup | bool

View File

@ -8,10 +8,6 @@
bridges: "{{ bridges_configuration | filter_enabled_bridges(applications | get_app_conf(application_id, 'plugins', True)) }}" bridges: "{{ bridges_configuration | filter_enabled_bridges(applications | get_app_conf(application_id, 'plugins', True)) }}"
changed_when: false changed_when: false
- name: "load docker and db for {{application_id}}"
include_role:
name: cmp-db-docker
- name: "include role for {{application_id}} to receive certs & do modification routines" - name: "include role for {{application_id}} to receive certs & do modification routines"
include_role: include_role:
name: srv-web-7-6-composer name: srv-web-7-6-composer
@ -19,6 +15,12 @@
domain: "{{domains[application_id].synapse}}" domain: "{{domains[application_id].synapse}}"
http_port: "{{ports.localhost.http['web-app-matrix_synapse']}}" http_port: "{{ports.localhost.http['web-app-matrix_synapse']}}"
- name: "load docker and db for {{application_id}}"
include_role:
name: cmp-db-docker
vars:
docker_compose_flush_handlers: false
- name: create {{well_known_directory}} - name: create {{well_known_directory}}
file: file:
path: "{{well_known_directory}}" path: "{{well_known_directory}}"

View File

@ -18,6 +18,3 @@ matrix_project: "{{ application_id | get_entity_name }}"
well_known_directory: "{{nginx.directories.data.well_known}}/matrix/" well_known_directory: "{{nginx.directories.data.well_known}}/matrix/"
location_upload: "~ ^/_matrix/media/v3/" location_upload: "~ ^/_matrix/media/v3/"
client_max_body_size: "{{ applications | get_app_conf(application_id, 'server.client_max_body_size') }}" client_max_body_size: "{{ applications | get_app_conf(application_id, 'server.client_max_body_size') }}"
# Docker
docker_compose_flush_handlers: false

View File

@ -6,16 +6,16 @@
- include_tasks: utils/run_once.yml - include_tasks: utils/run_once.yml
when: run_once_web_app_mybb is not defined when: run_once_web_app_mybb is not defined
- name: "load docker and db for {{application_id}}"
include_role:
name: cmp-db-docker
- name: "include tasks setup-domain.yml with {{domains | get_domain(application_id)}}" - name: "include tasks setup-domain.yml with {{domains | get_domain(application_id)}}"
include_tasks: setup-domain.yml include_tasks: setup-domain.yml
loop: "{{ mybb_domains + [source_domain] }}" loop: "{{ mybb_domains + [source_domain] }}"
loop_control: loop_control:
loop_var: domain loop_var: domain
- name: "load docker and db for {{application_id}}"
include_role:
name: cmp-db-docker
- name: "create {{docker_compose_instance_confd_directory}} and parent directories" - name: "create {{docker_compose_instance_confd_directory}} and parent directories"
file: file:
path: "{{docker_compose_instance_confd_directory}}" path: "{{docker_compose_instance_confd_directory}}"

View File

@ -1,8 +1,4 @@
--- ---
- name: "load docker and db for {{application_id}}"
include_role:
name: cmp-db-docker
- name: "include create-domains.yml for peertube" - name: "include create-domains.yml for peertube"
include_tasks: create-domains.yml include_tasks: create-domains.yml
loop: "{{ domains['web-app-peertube'] }}" loop: "{{ domains['web-app-peertube'] }}"
@ -13,6 +9,10 @@
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
ws_port: "{{ ports.localhost.http[application_id] }}" ws_port: "{{ ports.localhost.http[application_id] }}"
- name: "load docker and db for {{application_id}}"
include_role:
name: cmp-db-docker
- name: "Install and activate auth-openid-connect plugin if OIDC is enabled" - name: "Install and activate auth-openid-connect plugin if OIDC is enabled"
include_tasks: enable-oidc.yml include_tasks: enable-oidc.yml
when: applications | get_app_conf(application_id, 'features.oidc', False) when: applications | get_app_conf(application_id, 'features.oidc', False)

View File

@ -0,0 +1,2 @@
# Todo
- This role needs to be fully implemented

View File

@ -1,10 +1,7 @@
--- ---
- block:
- name: "load docker and db for {{application_id}}" - name: "load docker and db for {{application_id}}"
include_role: include_role:
name: cmp-db-docker name: cmp-db-docker
when: run_once_web_app_pretix is not defined - include_tasks: utils/run_once.yml
- name: run the pretix tasks once
set_fact:
run_once_web_app_pretix: true
when: run_once_web_app_pretix is not defined when: run_once_web_app_pretix is not defined

View File

@ -1,17 +1,11 @@
--- ---
- name: "load docker and db for {{application_id}}"
include_role:
name: cmp-db-docker
- name: "include role for {{application_id}} to receive certs & do modification routines" - name: "include role for {{application_id}} to receive certs & do modification routines"
include_role: include_role:
name: srv-web-7-6-composer name: srv-web-7-6-composer
- name: configure {{domain}}.conf - name: "load docker and db for {{application_id}}"
template: include_role:
src: "templates/proxy.conf.j2" name: cmp-db-docker
dest: "{{nginx.directories.http.servers}}{{domain}}.conf"
notify: restart openresty
- name: configure {{domain}}.conf - name: configure {{domain}}.conf
template: template:

View File

@ -1,4 +1,5 @@
- name: "Run WordPress core install via WP CLI" - name: "Run WordPress core install via WP CLI"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
command: > command: >
docker exec -u {{ wordpress_user }} {{ wordpress_container }} docker exec -u {{ wordpress_user }} {{ wordpress_container }}
wp core install wp core install

View File

@ -1,10 +1,4 @@
--- ---
- name: "load docker and db for {{application_id}}"
include_role:
name: cmp-db-docker
vars:
docker_compose_flush_handlers: false
- name: "Include role srv-proxy-6-6-domain for {{ application_id }}" - name: "Include role srv-proxy-6-6-domain for {{ application_id }}"
include_role: include_role:
name: srv-proxy-6-6-domain name: srv-proxy-6-6-domain
@ -15,6 +9,12 @@
proxy_extra_configuration: "client_max_body_size {{ wordpress_max_upload_size }};" proxy_extra_configuration: "client_max_body_size {{ wordpress_max_upload_size }};"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- name: "load docker and db for {{application_id}}"
include_role:
name: cmp-db-docker
vars:
docker_compose_flush_handlers: false
- name: "Transfering upload.ini to {{ docker_compose.directories.instance }}" - name: "Transfering upload.ini to {{ docker_compose.directories.instance }}"
template: template:
src: upload.ini.j2 src: upload.ini.j2