Optimized handler loading. Requirerd due to 2.18->2.20 update

This commit is contained in:
2025-12-04 00:53:27 +01:00
parent 7b262cf46e
commit 27c399123b
13 changed files with 34 additions and 21 deletions

View File

@@ -1,7 +1,7 @@
- include_tasks: 01_core.yml
when: run_once_svc_db_postgres is not defined
- include_tasks: "{{ [ playbook_dir, 'tasks/utils/load_handlers.yml' ] | path_join }}"
- include_tasks: utils/load_handlers.yml
# Necessary because docker handlers are overwritten by condition
vars:
handler_role_name: "docker-compose"

View File

@@ -1,14 +1,5 @@
# run_once_sys_front_inj_matomo: deactivated
- name: "Relevant variables for role: {{ role_path | basename }}"
debug:
msg:
domain: "{{ domain }}"
base_domain: "{{ base_domain }}"
matomo_verification_url: "{{ matomo_verification_url }}"
when: MODE_DEBUG | bool
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: "Check if site {{ domain }} is allready registered at Matomo"
uri:
url: "{{ matomo_verification_url }}"

View File

@@ -1,5 +1,5 @@
- name: "Reload sys-daemon handlers"
include_tasks: "{{ [ playbook_dir, 'tasks/utils/load_handlers.yml' ] | path_join }}"
include_tasks: utils/load_handlers.yml
vars:
handler_role_name: "sys-daemon"
when: run_once_sys_service is defined

View File

@@ -9,6 +9,7 @@
- include_tasks: "01_cloudflare.yml"
when: DNS_PROVIDER == "cloudflare"
- include_tasks: "{{ [ playbook_dir, 'tasks/utils/load_handlers.yml' ] | path_join }}"
- name: "Reinitialize OpenResty Handler"
include_tasks: utils/load_handlers.yml
vars:
handler_role_name: "svc-prx-openresty"

View File

@@ -1,7 +1,3 @@
- include_tasks: "{{ [ playbook_dir, 'tasks/utils/load_handlers.yml' ] | path_join }}"
vars:
handler_role_name: "svc-prx-openresty"
- name: Front bootstrap
include_role:
name: sys-stk-front-base
@@ -10,6 +6,11 @@
include_role:
name: sys-util-csp-cert
- name: "Reinitialize OpenResty Handler"
include_tasks: utils/load_handlers.yml
vars:
handler_role_name: "svc-prx-openresty"
- name: "Copy nginx config to '{{ front_proxy_domain_conf_dst }}'"
template:
src: "{{ item }}"

View File

@@ -1,6 +1,7 @@
# run_once_sys_stk_full_stateful: deactivated
- include_tasks: "{{ [ playbook_dir, 'tasks/utils/load_handlers.yml' ] | path_join }}"
- name: "Reinitialize OpenResty Handler"
include_tasks: utils/load_handlers.yml
vars:
handler_role_name: "svc-prx-openresty"

View File

@@ -5,6 +5,11 @@
patterns: "*.{{ domain }}.conf"
register: find_result
- name: "Reinitialize OpenResty Handler"
include_tasks: utils/load_handlers.yml
vars:
handler_role_name: "svc-prx-openresty"
- name: Remove wildcard nginx configs for {{ domain }}
ansible.builtin.file:
path: "{{ item.path }}"

View File

@@ -5,3 +5,12 @@
state: restarted
enabled: yes
when: not (IS_CONTAINER | bool)
listen: docker restart
- name: Ensure Docker daemon is running inside container
shell: docker info
register: docker_info
failed_when: docker_info.rc != 0
changed_when: false
when: IS_CONTAINER | bool
listen: docker restart

View File

@@ -3,6 +3,11 @@
name: sys-ctl-mtn-cert-renew
when: run_once_sys_ctl_mtn_cert_renew is not defined
- name: "Reinitialize OpenResty Handler"
include_tasks: utils/load_handlers.yml
vars:
handler_role_name: "svc-prx-openresty"
- name: create nginx letsencrypt config file
template:
src: "letsencrypt.conf.j2"

View File

@@ -4,6 +4,6 @@
load_app_id: web-app-mailu
- name: "Reset compose handlers after Mailu include for MSMTP"
include_tasks: "{{ [ playbook_dir, 'tasks/utils/load_handlers.yml' ] | path_join }}"
include_tasks: utils/load_handlers.yml
vars:
handler_role_name: "docker-compose"

View File

@@ -12,7 +12,7 @@
include_vars: "{{ DOCKER_VARS_FILE }}"
- name: "Load docker compose & openresty handlers"
include_tasks: "{{ [ playbook_dir, 'tasks/utils/load_handlers.yml' ] | path_join }}"
include_tasks: utils/load_handlers.yml
loop:
- docker-compose
- svc-prx-openresty

View File

@@ -1,4 +1,4 @@
- include_tasks: "{{ [ playbook_dir, 'tasks/utils/load_handlers.yml' ] | path_join }}"
- include_tasks: utils/load_handlers.yml
vars:
handler_role_name: "docker-compose"
- ansible.builtin.include_vars:

View File

@@ -3,6 +3,6 @@
vars:
application_id: 'web-svc-cdn'
- include_tasks: "{{ [ playbook_dir, 'tasks/utils/load_handlers.yml' ] | path_join }}"
- include_tasks: utils/load_handlers.yml
vars:
handler_role_name: "docker-compose"