Add conditional restart support to service roles

Track config/image/systemd changes via register: directives and compute
a _restart_necessary variable for each service role, allowing the
systemd_service_manager to skip unnecessary restarts during install-* runs.

Covers 22 service roles: alertmanager-receiver, appservice-draupnir-for-all,
bridge-mautrix-wsproxy (+ syncproxy), cactus-comments, cactus-comments-client,
corporal, element-admin, ldap-registration-proxy, livekit-jwt-service, matrixto,
pantalaimon, prometheus-nginxlog-exporter, rageshake, registration, static-files,
sygnal, synapse-admin, synapse-auto-compressor, synapse-reverse-proxy-companion,
synapse-usage-exporter, and user-verification-service.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Slavi Pantaleev
2026-02-13 16:01:46 +02:00
parent 16010ff8c7
commit 0d86610cbe
43 changed files with 550 additions and 58 deletions

View File

@@ -290,7 +290,7 @@ devture_systemd_service_manager_services_list_auto: |
([{
'name': 'matrix-alertmanager-receiver.service',
'priority': 2200,
'restart_necessary': true,
'restart_necessary': (matrix_alertmanager_receiver_restart_necessary | bool),
'groups': ['matrix', 'alertmanager-receiver'],
}] if matrix_alertmanager_receiver_enabled else [])
+
@@ -374,7 +374,7 @@ devture_systemd_service_manager_services_list_auto: |
([{
'name': 'matrix-appservice-draupnir-for-all.service',
'priority': 4000,
'restart_necessary': true,
'restart_necessary': (matrix_appservice_draupnir_for_all_restart_necessary | bool),
'groups': ['matrix', 'bridges', 'draupnir-for-all', 'appservice-draupnir-for-all'],
}] if matrix_appservice_draupnir_for_all_enabled else [])
+
@@ -521,14 +521,14 @@ devture_systemd_service_manager_services_list_auto: |
([{
'name': 'matrix-mautrix-wsproxy.service',
'priority': 2000,
'restart_necessary': true,
'restart_necessary': (matrix_mautrix_wsproxy_restart_necessary | bool),
'groups': ['matrix', 'bridges', 'mautrix-wsproxy'],
}] if matrix_mautrix_wsproxy_enabled else [])
+
([{
'name': 'matrix-mautrix-wsproxy-syncproxy.service',
'priority': 2000,
'restart_necessary': true,
'restart_necessary': (matrix_mautrix_wsproxy_syncproxy_restart_necessary | bool),
'groups': ['matrix', 'bridges', 'mautrix-wsproxy-syncproxy'],
}] if matrix_mautrix_wsproxy_enabled else [])
+
@@ -570,14 +570,14 @@ devture_systemd_service_manager_services_list_auto: |
([{
'name': 'matrix-cactus-comments.service',
'priority': 2000,
'restart_necessary': true,
'restart_necessary': (matrix_cactus_comments_restart_necessary | bool),
'groups': ['matrix', 'cactus-comments'],
}] if matrix_cactus_comments_enabled else [])
+
([{
'name': 'matrix-cactus-comments-client.service',
'priority': 2000,
'restart_necessary': true,
'restart_necessary': (matrix_cactus_comments_client_restart_necessary | bool),
'groups': ['matrix', 'cactus-comments-client'],
}] if matrix_cactus_comments_client_enabled else [])
+
@@ -626,7 +626,7 @@ devture_systemd_service_manager_services_list_auto: |
([{
'name': 'matrix-corporal.service',
'priority': 1500,
'restart_necessary': true,
'restart_necessary': (matrix_corporal_restart_necessary | bool),
'groups': ['matrix', 'corporal'],
}] if matrix_corporal_enabled else [])
+
@@ -640,14 +640,14 @@ devture_systemd_service_manager_services_list_auto: |
([{
'name': 'matrix-matrixto.service',
'priority': 4000,
'restart_necessary': true,
'restart_necessary': (matrix_matrixto_restart_necessary | bool),
'groups': ['matrix', 'matrixto'],
}] if matrix_matrixto_enabled else [])
+
([{
'name': 'matrix-rageshake.service',
'priority': 4000,
'restart_necessary': true,
'restart_necessary': (matrix_rageshake_restart_necessary | bool),
'groups': ['matrix', 'rageshake'],
}] if matrix_rageshake_enabled else [])
+
@@ -710,7 +710,7 @@ devture_systemd_service_manager_services_list_auto: |
([{
'name': 'matrix-ldap-registration-proxy.service',
'priority': 2000,
'restart_necessary': true,
'restart_necessary': (matrix_ldap_registration_proxy_restart_necessary | bool),
'groups': ['matrix', 'ldap-registration-proxy'],
}] if matrix_ldap_registration_proxy_enabled else [])
+
@@ -773,7 +773,7 @@ devture_systemd_service_manager_services_list_auto: |
([{
'name': 'matrix-prometheus-nginxlog-exporter.service',
'priority': 3900,
'restart_necessary': true,
'restart_necessary': (matrix_prometheus_nginxlog_exporter_restart_necessary | bool),
'groups': ['matrix', 'monitoring', 'prometheus-exporters', 'prometheus-nginxlog-exporter'],
}] if matrix_prometheus_nginxlog_exporter_enabled else [])
+
@@ -787,14 +787,14 @@ devture_systemd_service_manager_services_list_auto: |
([{
'name': 'matrix-pantalaimon.service',
'priority': 4000,
'restart_necessary': true,
'restart_necessary': (matrix_pantalaimon_restart_necessary | bool),
'groups': ['matrix', 'pantalaimon'],
}] if matrix_pantalaimon_enabled else [])
+
([{
'name': 'matrix-element-admin.service',
'priority': 4000,
'restart_necessary': true,
'restart_necessary': (matrix_element_admin_restart_necessary | bool),
'groups': ['matrix', 'element-admin'],
}] if matrix_element_admin_enabled else [])
+
@@ -808,7 +808,7 @@ devture_systemd_service_manager_services_list_auto: |
([{
'name': 'matrix-livekit-jwt-service.service',
'priority': 3500,
'restart_necessary': true,
'restart_necessary': (matrix_livekit_jwt_service_restart_necessary | bool),
'groups': ['matrix', 'livekit-jwt-service'],
}] if matrix_livekit_jwt_service_enabled else [])
+
@@ -822,14 +822,14 @@ devture_systemd_service_manager_services_list_auto: |
([{
'name': 'matrix-registration.service',
'priority': 4000,
'restart_necessary': true,
'restart_necessary': (matrix_registration_restart_necessary | bool),
'groups': ['matrix', 'registration', 'matrix-registration'],
}] if matrix_registration_enabled else [])
+
([{
'name': 'matrix-sygnal.service',
'priority': 800,
'restart_necessary': true,
'restart_necessary': (matrix_sygnal_restart_necessary | bool),
'groups': ['matrix', 'sygnal'],
}] if matrix_sygnal_enabled else [])
+
@@ -850,42 +850,42 @@ devture_systemd_service_manager_services_list_auto: |
([{
'name': 'matrix-synapse-auto-compressor.timer',
'priority': 5000,
'restart_necessary': true,
'restart_necessary': (matrix_synapse_auto_compressor_restart_necessary | bool),
'groups': ['matrix', 'synapse-auto-compressor'],
}] if matrix_synapse_auto_compressor_enabled else [])
+
([{
'name': 'matrix-synapse-admin.service',
'priority': 4000,
'restart_necessary': true,
'restart_necessary': (matrix_synapse_admin_restart_necessary | bool),
'groups': ['matrix', 'synapse-admin'],
}] if matrix_synapse_admin_enabled else [])
+
([{
'name': (matrix_synapse_usage_exporter_identifier + '.service'),
'priority': 4000,
'restart_necessary': true,
'restart_necessary': (matrix_synapse_usage_exporter_restart_necessary | bool),
'groups': ['matrix', 'synapse-usage-exporter'],
}] if matrix_synapse_usage_exporter_enabled else [])
+
([{
'name': 'matrix-synapse-reverse-proxy-companion.service',
'priority': 1500,
'restart_necessary': true,
'restart_necessary': (matrix_synapse_reverse_proxy_companion_restart_necessary | bool),
'groups': ['matrix', 'homeservers', 'synapse', 'synapse-reverse-proxy-companion', 'reverse-proxies'],
}] if matrix_synapse_reverse_proxy_companion_enabled else [])
+
([{
'name': 'matrix-user-verification-service.service',
'priority': 800,
'restart_necessary': true,
'restart_necessary': (matrix_user_verification_service_restart_necessary | bool),
'groups': ['matrix', 'matrix-user-verification-service'],
}] if matrix_user_verification_service_enabled else [])
+
([{
'name': (matrix_static_files_identifier + '.service'),
'priority': 4000,
'restart_necessary': true,
'restart_necessary': (matrix_static_files_restart_necessary | bool),
'groups': ['matrix', 'matrix-static-files'],
}] if matrix_static_files_enabled else [])
+

View File

@@ -235,3 +235,13 @@ matrix_alertmanager_receiver_configuration_extension: "{{ matrix_alertmanager_re
# Holds the final matrix-alertmanager-receiver configuration (a combination of the default and its extension).
# You most likely don't need to touch this variable. Instead, see `matrix_alertmanager_receiver_configuration_yaml`.
matrix_alertmanager_receiver_configuration: "{{ matrix_alertmanager_receiver_configuration_yaml | from_yaml | combine(matrix_alertmanager_receiver_configuration_extension, recursive=True) }}"
# matrix_alertmanager_receiver_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_alertmanager_receiver_restart_necessary: false

View File

@@ -28,6 +28,7 @@
mode: 0644
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_alertmanager_receiver_config_result
- name: Ensure matrix-alertmanager-receiver support files installed
ansible.builtin.template:
@@ -38,6 +39,7 @@
group: "{{ matrix_group_name }}"
with_items:
- labels
register: matrix_alertmanager_receiver_support_files_result
- name: Ensure matrix-alertmanager-receiver container image is pulled
community.docker.docker_image:
@@ -46,10 +48,10 @@
force_source: "{{ matrix_alertmanager_receiver_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_alertmanager_receiver_container_image_force_pull }}"
when: "not matrix_alertmanager_receiver_container_image_self_build | bool"
register: result
register: matrix_alertmanager_receiver_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_alertmanager_receiver_container_image_pull_result is not failed
- when: matrix_alertmanager_receiver_container_image_self_build | bool
block:
@@ -84,3 +86,14 @@
src: "{{ role_path }}/templates/systemd/matrix-alertmanager-receiver.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-alertmanager-receiver.service"
mode: 0644
register: matrix_alertmanager_receiver_systemd_service_result
- name: Determine whether matrix-alertmanager-receiver needs a restart
ansible.builtin.set_fact:
matrix_alertmanager_receiver_restart_necessary: >-
{{
matrix_alertmanager_receiver_config_result.changed | default(false)
or matrix_alertmanager_receiver_support_files_result.changed | default(false)
or matrix_alertmanager_receiver_systemd_service_result.changed | default(false)
or matrix_alertmanager_receiver_container_image_pull_result.changed | default(false)
}}

View File

@@ -110,3 +110,13 @@ matrix_appservice_draupnir_for_all_configuration_extension: "{{ matrix_appservic
# Holds the final configuration (a combination of the default and its extension).
# You most likely don't need to touch this variable. Instead, see `matrix_appservice_draupnir_for_all_configuration_yaml`.
matrix_appservice_draupnir_for_all_configuration: "{{ matrix_appservice_draupnir_for_all_configuration_yaml | from_yaml | combine(matrix_appservice_draupnir_for_all_configuration_extension, recursive=True) }}"
# matrix_appservice_draupnir_for_all_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_appservice_draupnir_for_all_restart_necessary: false

View File

@@ -32,10 +32,10 @@
force_source: "{{ matrix_appservice_draupnir_for_all_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_appservice_draupnir_for_all_docker_image_force_pull }}"
when: "not matrix_appservice_draupnir_for_all_container_image_self_build | bool"
register: result
register: matrix_appservice_draupnir_for_all_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_appservice_draupnir_for_all_container_image_pull_result is not failed
- name: Ensure Draupnir repository is present on self-build
ansible.builtin.git:
@@ -66,6 +66,7 @@
mode: 0644
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_appservice_draupnir_for_all_appservice_config_result
- name: Ensure matrix-appservice-draupnir-for-all bot config installed
ansible.builtin.copy:
@@ -74,6 +75,7 @@
mode: 0644
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_appservice_draupnir_for_all_bot_config_result
- name: Ensure matrix-appservice-draupnir-for-all registration.yaml installed
ansible.builtin.copy:
@@ -82,6 +84,7 @@
mode: 0644
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_appservice_draupnir_for_all_registration_config_result
- name: Ensure matrix-appservice-draupnir-for-all container network is created
community.general.docker_network:
@@ -97,6 +100,18 @@
mode: 0644
register: matrix_appservice_draupnir_for_all_systemd_service_result
- name: Determine whether Draupnir for All needs a restart
ansible.builtin.set_fact:
matrix_appservice_draupnir_for_all_restart_necessary: >-
{{
matrix_appservice_draupnir_for_all_migration_requires_restart | default(false)
or matrix_appservice_draupnir_for_all_appservice_config_result.changed | default(false)
or matrix_appservice_draupnir_for_all_bot_config_result.changed | default(false)
or matrix_appservice_draupnir_for_all_registration_config_result.changed | default(false)
or matrix_appservice_draupnir_for_all_systemd_service_result.changed | default(false)
or matrix_appservice_draupnir_for_all_container_image_pull_result.changed | default(false)
}}
- name: Ensure matrix-appservice-draupnir-for-all.service restarted, if necessary
ansible.builtin.service:
name: "matrix-appservice-draupnir-for-all.service"

View File

@@ -178,3 +178,23 @@ matrix_mautrix_wsproxy_syncproxy_database_port: 5432
matrix_mautrix_wsproxy_syncproxy_database_name: 'matrix_mautrix_wsproxy_syncproxy'
matrix_mautrix_signal_wsproxy_syncproxy_connection_string: 'postgres://{{ matrix_mautrix_wsproxy_syncproxy_database_username }}:{{ matrix_mautrix_wsproxy_syncproxy_database_password }}@{{ matrix_mautrix_wsproxy_syncproxy_database_hostname }}:{{ matrix_mautrix_wsproxy_syncproxy_database_port }}/{{ matrix_mautrix_wsproxy_syncproxy_database_name }}'
# matrix_mautrix_wsproxy_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_mautrix_wsproxy_restart_necessary: false
# matrix_mautrix_wsproxy_syncproxy_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_mautrix_wsproxy_syncproxy_restart_necessary: false

View File

@@ -43,6 +43,7 @@
with_items:
- syncproxy-env
- wsproxy-labels
register: matrix_mautrix_wsproxy_support_files_result
- name: Ensure Mautrix wsproxy image is pulled
community.docker.docker_image:
@@ -50,6 +51,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_mautrix_wsproxy_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_wsproxy_docker_image_force_pull }}"
register: matrix_mautrix_wsproxy_container_image_pull_result
- name: Ensure Mautrix syncproxy image is pulled
community.docker.docker_image:
@@ -57,6 +59,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_mautrix_wsproxy_syncproxy_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_wsproxy_syncproxy_docker_image_force_pull }}"
register: matrix_mautrix_wsproxy_syncproxy_container_image_pull_result
- name: Ensure Mautrix wsproxy paths exists
ansible.builtin.file:
@@ -81,6 +84,7 @@
mode: 0644
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_mautrix_wsproxy_config_result
- name: Ensure mautrix-androidsms registration.yaml installed
ansible.builtin.copy:
@@ -89,6 +93,7 @@
mode: 0644
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_mautrix_wsproxy_registration_androidsms_result
- name: Ensure mautrix-imessage registration.yaml installed
ansible.builtin.copy:
@@ -97,6 +102,7 @@
mode: 0644
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_mautrix_wsproxy_registration_imessage_result
- name: Ensure mautrix-wsproxy container network is created
community.general.docker_network:
@@ -112,6 +118,19 @@
mode: 0644
register: matrix_mautrix_wsproxy_systemd_service_result
- name: Determine whether Mautrix wsproxy needs a restart
ansible.builtin.set_fact:
matrix_mautrix_wsproxy_restart_necessary: >-
{{
matrix_mautrix_wsproxy_migration_requires_restart | default(false)
or matrix_mautrix_wsproxy_support_files_result.changed | default(false)
or matrix_mautrix_wsproxy_config_result.changed | default(false)
or matrix_mautrix_wsproxy_registration_androidsms_result.changed | default(false)
or matrix_mautrix_wsproxy_registration_imessage_result.changed | default(false)
or matrix_mautrix_wsproxy_systemd_service_result.changed | default(false)
or matrix_mautrix_wsproxy_container_image_pull_result.changed | default(false)
}}
- name: Ensure systemd reloaded after matrix-mautrix-wsproxy.service installation
ansible.builtin.service:
daemon_reload: true
@@ -130,6 +149,15 @@
mode: 0644
register: matrix_mautrix_wsproxy_syncproxy_systemd_service_result
- name: Determine whether Mautrix wsproxy syncproxy needs a restart
ansible.builtin.set_fact:
matrix_mautrix_wsproxy_syncproxy_restart_necessary: >-
{{
matrix_mautrix_wsproxy_syncproxy_migration_requires_restart | default(false)
or matrix_mautrix_wsproxy_syncproxy_systemd_service_result.changed | default(false)
or matrix_mautrix_wsproxy_syncproxy_container_image_pull_result.changed | default(false)
}}
- name: Ensure systemd reloaded after matrix-mautrix-wsproxy-syncproxy.service installation
ansible.builtin.service:
daemon_reload: true

View File

@@ -108,3 +108,13 @@ matrix_cactus_comments_client_systemd_required_services_list: "{{ [devture_syste
matrix_cactus_comments_client_systemd_wanted_services_list: "{{ matrix_cactus_comments_client_systemd_wanted_services_list_auto + matrix_cactus_comments_client_systemd_wanted_services_list_custom }}"
matrix_cactus_comments_client_systemd_wanted_services_list_auto: []
matrix_cactus_comments_client_systemd_wanted_services_list_custom: []
# matrix_cactus_comments_client_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_cactus_comments_client_restart_necessary: false

View File

@@ -30,6 +30,7 @@
- src: "{{ role_path }}/templates/labels.j2"
dest: "{{ matrix_cactus_comments_client_base_path }}/labels"
register: matrix_cactus_comments_client_support_files_result
- when: matrix_cactus_comments_client_local_dir | length == 0
block:
@@ -71,10 +72,10 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_cactus_comments_client_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_cactus_comments_client_container_image_force_pull }}"
register: result
register: matrix_cactus_comments_client_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_cactus_comments_client_container_image_pull_result is not failed
- name: Ensure matrix-cactus-comments-client container network is created
community.general.docker_network:
@@ -88,3 +89,13 @@
src: "{{ role_path }}/templates/systemd/matrix-cactus-comments-client.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-cactus-comments-client.service"
mode: 0644
register: matrix_cactus_comments_client_systemd_service_result
- name: Determine whether matrix-cactus-comments-client needs a restart
ansible.builtin.set_fact:
matrix_cactus_comments_client_restart_necessary: >-
{{
matrix_cactus_comments_client_support_files_result.changed | default(false)
or matrix_cactus_comments_client_systemd_service_result.changed | default(false)
or matrix_cactus_comments_client_container_image_pull_result.changed | default(false)
}}

View File

@@ -56,3 +56,13 @@ matrix_cactus_comments_systemd_required_services_list: "{{ [devture_systemd_dock
matrix_cactus_comments_systemd_wanted_services_list: []
matrix_cactus_comments_environment_variables_extension: ''
# matrix_cactus_comments_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_cactus_comments_restart_necessary: false

View File

@@ -26,6 +26,7 @@
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
mode: 0640
register: matrix_cactus_comments_config_env_result
- name: Ensure matrix-cactus-comments appservice file created
ansible.builtin.template:
@@ -34,6 +35,7 @@
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
mode: 0640
register: matrix_cactus_comments_config_appservice_result
- name: Ensure matrix-cactus-comments image is pulled
community.docker.docker_image:
@@ -42,10 +44,10 @@
force_source: "{{ matrix_cactus_comments_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_cactus_comments_docker_image_force_pull }}"
when: "not matrix_cactus_comments_container_image_self_build | bool"
register: result
register: matrix_cactus_comments_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_cactus_comments_container_image_pull_result is not failed
- name: Ensure matrix-cactus-comments repository is present on self-build
ansible.builtin.git:
@@ -75,3 +77,14 @@
src: "{{ role_path }}/templates/systemd/matrix-cactus-comments.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-cactus-comments.service"
mode: 0644
register: matrix_cactus_comments_systemd_service_result
- name: Determine whether matrix-cactus-comments needs a restart
ansible.builtin.set_fact:
matrix_cactus_comments_restart_necessary: >-
{{
matrix_cactus_comments_config_env_result.changed | default(false)
or matrix_cactus_comments_config_appservice_result.changed | default(false)
or matrix_cactus_comments_systemd_service_result.changed | default(false)
or matrix_cactus_comments_container_image_pull_result.changed | default(false)
}}

View File

@@ -180,3 +180,13 @@ matrix_corporal_configuration: "{{ matrix_corporal_configuration_default | combi
matrix_corporal_self_check_matrix_client_api_url_endpoint_public: "{{ matrix_corporal_matrix_homeserver_scheme }}://{{ matrix_corporal_matrix_homeserver_api_domain_name }}/_matrix/client/corporal"
matrix_corporal_self_check_corporal_api_url_endpoint_public: "{{ matrix_corporal_matrix_homeserver_scheme }}://{{ matrix_corporal_matrix_homeserver_api_domain_name }}/_matrix/corporal/policy"
# matrix_corporal_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_corporal_restart_necessary: false

View File

@@ -54,10 +54,10 @@
force_source: "{{ matrix_corporal_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_corporal_docker_image_force_pull }}"
when: not matrix_corporal_container_image_self_build | bool
register: result
register: matrix_corporal_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_corporal_container_image_pull_result is not failed
- name: Ensure Matrix Corporal config installed
ansible.builtin.copy:
@@ -66,6 +66,7 @@
mode: 0644
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_corporal_config_result
- name: Ensure Matrix Corporal support files installed
ansible.builtin.template:
@@ -76,6 +77,7 @@
group: "{{ matrix_group_name }}"
with_items:
- labels
register: matrix_corporal_support_files_result
- name: Ensure Matrix Corporal container network is created
community.general.docker_network:
@@ -90,3 +92,13 @@
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-corporal.service"
mode: 0644
register: matrix_corporal_systemd_service_result
- name: Determine whether matrix-corporal needs a restart
ansible.builtin.set_fact:
matrix_corporal_restart_necessary: >-
{{
matrix_corporal_config_result.changed | default(false)
or matrix_corporal_support_files_result.changed | default(false)
or matrix_corporal_systemd_service_result.changed | default(false)
or matrix_corporal_container_image_pull_result.changed | default(false)
}}

View File

@@ -95,3 +95,13 @@ matrix_element_admin_environment_variable_server_name: "{{ matrix_domain }}"
# SOMETHING=1
# ANOTHER="here"
matrix_element_admin_environment_variables_additional_variables: ''
# matrix_element_admin_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_element_admin_restart_necessary: false

View File

@@ -29,6 +29,7 @@
with_items:
- labels
- env
register: matrix_element_admin_support_files_result
- name: Ensure Element Admin container image is pulled
community.docker.docker_image:
@@ -37,10 +38,10 @@
force_source: "{{ matrix_element_admin_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_element_admin_container_image_force_pull }}"
when: "not matrix_element_admin_container_image_self_build | bool"
register: result
register: matrix_element_admin_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_element_admin_container_image_pull_result is not failed
- when: matrix_element_admin_container_image_self_build | bool
block:
@@ -75,3 +76,13 @@
src: "{{ role_path }}/templates/systemd/matrix-element-admin.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-element-admin.service"
mode: 0644
register: matrix_element_admin_systemd_service_result
- name: Determine whether Element Admin needs a restart
ansible.builtin.set_fact:
matrix_element_admin_restart_necessary: >-
{{
matrix_element_admin_support_files_result.changed | default(false)
or matrix_element_admin_systemd_service_result.changed | default(false)
or matrix_element_admin_container_image_pull_result.changed | default(false)
}}

View File

@@ -100,3 +100,13 @@ matrix_ldap_registration_proxy_systemd_wanted_services_list_custom: []
# matrix_ldap_registration_proxy_env_variables_extension: |
# KEY=value
matrix_ldap_registration_proxy_env_variables_extension: ''
# matrix_ldap_registration_proxy_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_ldap_registration_proxy_restart_necessary: false

View File

@@ -48,6 +48,7 @@
mode: 0644
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_ldap_registration_proxy_config_result
- name: Ensure matrix-ldap-registration-proxy support files installed
ansible.builtin.template:
@@ -58,6 +59,7 @@
group: "{{ matrix_group_name }}"
with_items:
- labels
register: matrix_ldap_registration_proxy_support_files_result
- name: Ensure matrix-ldap-registration-proxy container network is created
community.general.docker_network:
@@ -71,3 +73,13 @@
src: "{{ role_path }}/templates/systemd/matrix-ldap-registration-proxy.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-ldap-registration-proxy.service"
mode: 0644
register: matrix_ldap_registration_proxy_systemd_service_result
- name: Determine whether matrix-ldap-registration-proxy needs a restart
ansible.builtin.set_fact:
matrix_ldap_registration_proxy_restart_necessary: >-
{{
matrix_ldap_registration_proxy_config_result.changed | default(false)
or matrix_ldap_registration_proxy_support_files_result.changed | default(false)
or matrix_ldap_registration_proxy_systemd_service_result.changed | default(false)
}}

View File

@@ -108,3 +108,13 @@ matrix_livekit_jwt_service_systemd_required_services_list: "{{ matrix_livekit_jw
matrix_livekit_jwt_service_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
matrix_livekit_jwt_service_systemd_required_services_list_auto: []
matrix_livekit_jwt_service_systemd_required_services_list_custom: []
# matrix_livekit_jwt_service_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_livekit_jwt_service_restart_necessary: false

View File

@@ -26,6 +26,7 @@
with_items:
- env
- labels
register: matrix_livekit_jwt_service_support_files_result
- name: Ensure LiveKit JWT Service container image is pulled
community.docker.docker_image:
@@ -34,10 +35,10 @@
force_source: "{{ matrix_livekit_jwt_service_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_livekit_jwt_service_container_image_force_pull }}"
when: "not matrix_livekit_jwt_service_container_image_self_build | bool"
register: result
register: matrix_livekit_jwt_service_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_livekit_jwt_service_container_image_pull_result is not failed
- when: "matrix_livekit_jwt_service_container_image_self_build | bool"
block:
@@ -74,3 +75,13 @@
src: "{{ role_path }}/templates/systemd/matrix-livekit-jwt-service.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-livekit-jwt-service.service"
mode: 0644
register: matrix_livekit_jwt_service_systemd_service_result
- name: Determine whether LiveKit JWT Service needs a restart
ansible.builtin.set_fact:
matrix_livekit_jwt_service_restart_necessary: >-
{{
matrix_livekit_jwt_service_support_files_result.changed | default(false)
or matrix_livekit_jwt_service_systemd_service_result.changed | default(false)
or matrix_livekit_jwt_service_container_image_pull_result.changed | default(false)
}}

View File

@@ -170,3 +170,13 @@ matrix_matrixto_systemd_wanted_services_list_custom: []
# Additional environment variables.
matrix_matrixto_environment_variables_additional_variables: ""
# matrix_matrixto_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_matrixto_restart_necessary: false

View File

@@ -24,6 +24,7 @@
with_items:
- env
- labels
register: matrix_matrixto_support_files_result
- name: Ensure Matrix.to repository is present on self-build
ansible.builtin.git:
@@ -70,3 +71,12 @@
src: "{{ role_path }}/templates/systemd/matrix-matrixto.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/{{ matrix_matrixto_identifier }}.service"
mode: "0644"
register: matrix_matrixto_systemd_service_result
- name: Determine whether Matrix.to needs a restart
ansible.builtin.set_fact:
matrix_matrixto_restart_necessary: >-
{{
matrix_matrixto_support_files_result.changed | default(false)
or matrix_matrixto_systemd_service_result.changed | default(false)
}}

View File

@@ -62,3 +62,13 @@ matrix_pantalaimon_homeserver_url: ""
# For a more advanced customization, you can
# completely replace this variable with your own template.
matrix_pantalaimon_configuration: "{{ lookup('template', 'templates/pantalaimon.conf.j2') }}"
# matrix_pantalaimon_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_pantalaimon_restart_necessary: false

View File

@@ -25,6 +25,7 @@
mode: 0644
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_pantalaimon_config_result
- name: Ensure pantalaimon container image is pulled
community.docker.docker_image:
@@ -33,10 +34,10 @@
force_source: "{{ matrix_pantalaimon_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_pantalaimon_docker_image_force_pull }}"
when: "not matrix_pantalaimon_container_image_self_build | bool"
register: result
register: matrix_pantalaimon_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_pantalaimon_container_image_pull_result is not failed
- name: Ensure pantalaimon repository is present on self-build
ansible.builtin.git:
@@ -72,3 +73,13 @@
src: "{{ role_path }}/templates/systemd/matrix-pantalaimon.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-pantalaimon.service"
mode: 0644
register: matrix_pantalaimon_systemd_service_result
- name: Determine whether Pantalaimon needs a restart
ansible.builtin.set_fact:
matrix_pantalaimon_restart_necessary: >-
{{
matrix_pantalaimon_config_result.changed | default(false)
or matrix_pantalaimon_systemd_service_result.changed | default(false)
or matrix_pantalaimon_container_image_pull_result.changed | default(false)
}}

View File

@@ -102,3 +102,13 @@ matrix_prometheus_nginxlog_exporter_container_syslog_host_bind_port: ''
matrix_prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags: "{{ matrix_prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_auto + matrix_prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_custom }}"
matrix_prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_auto: []
matrix_prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_custom: []
# matrix_prometheus_nginxlog_exporter_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_prometheus_nginxlog_exporter_restart_necessary: false

View File

@@ -12,10 +12,10 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_prometheus_nginxlog_exporter_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_prometheus_nginxlog_exporter_docker_image_force_pull }}"
register: result
register: matrix_prometheus_nginxlog_exporter_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_prometheus_nginxlog_exporter_container_image_pull_result is not failed
- name: Ensure prometheus-nginxlog-exporter paths exists
ansible.builtin.file:
@@ -35,6 +35,7 @@
mode: 0644
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_prometheus_nginxlog_exporter_config_result
- name: Ensure prometheus-nginxlog-exporter support files installed
ansible.builtin.template:
@@ -45,6 +46,7 @@
group: "{{ matrix_group_name }}"
with_items:
- labels
register: matrix_prometheus_nginxlog_exporter_support_files_result
- name: Ensure prometheus-nginxlog-exporter container network is created
community.general.docker_network:
@@ -58,3 +60,14 @@
src: "{{ role_path }}/templates/systemd/matrix-prometheus-nginxlog-exporter.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-prometheus-nginxlog-exporter.service"
mode: 0644
register: matrix_prometheus_nginxlog_exporter_systemd_service_result
- name: Determine whether matrix-prometheus-nginxlog-exporter needs a restart
ansible.builtin.set_fact:
matrix_prometheus_nginxlog_exporter_restart_necessary: >-
{{
matrix_prometheus_nginxlog_exporter_config_result.changed | default(false)
or matrix_prometheus_nginxlog_exporter_support_files_result.changed | default(false)
or matrix_prometheus_nginxlog_exporter_systemd_service_result.changed | default(false)
or matrix_prometheus_nginxlog_exporter_container_image_pull_result.changed | default(false)
}}

View File

@@ -122,3 +122,13 @@ matrix_rageshake_configuration_extension: "{{ matrix_rageshake_configuration_ext
# Holds the final Synapse configuration (a combination of the default and its extension).
# You most likely don't need to touch this variable. Instead, see `matrix_rageshake_configuration_yaml`.
matrix_rageshake_configuration: "{{ matrix_rageshake_configuration_yaml | from_yaml | combine(matrix_rageshake_configuration_extension, recursive=True) }}"
# matrix_rageshake_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_rageshake_restart_necessary: false

View File

@@ -30,6 +30,7 @@
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
mode: 0640
register: matrix_rageshake_config_result
- name: Ensure rageshake labels installed
ansible.builtin.template:
@@ -38,6 +39,7 @@
mode: 0640
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_rageshake_support_files_result
- name: Ensure rageshake image is pulled
community.docker.docker_image:
@@ -46,10 +48,10 @@
force_source: "{{ matrix_rageshake_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_rageshake_container_image_force_pull }}"
when: "not matrix_rageshake_container_image_self_build | bool"
register: result
register: matrix_rageshake_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_rageshake_container_image_pull_result is not failed
- name: Ensure rageshake repository is present on self-build
ansible.builtin.git:
@@ -84,3 +86,14 @@
src: "{{ role_path }}/templates/systemd/matrix-rageshake.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-rageshake.service"
mode: 0644
register: matrix_rageshake_systemd_service_result
- name: Determine whether Rageshake needs a restart
ansible.builtin.set_fact:
matrix_rageshake_restart_necessary: >-
{{
matrix_rageshake_config_result.changed | default(false)
or matrix_rageshake_support_files_result.changed | default(false)
or matrix_rageshake_systemd_service_result.changed | default(false)
or matrix_rageshake_container_image_pull_result.changed | default(false)
}}

View File

@@ -167,3 +167,13 @@ matrix_registration_configuration_extension: "{{ matrix_registration_configurati
# Holds the final matrix-registration configuration (a combination of the default and its extension).
# You most likely don't need to touch this variable. Instead, see `matrix_registration_configuration_yaml`.
matrix_registration_configuration: "{{ matrix_registration_configuration_yaml | from_yaml | combine(matrix_registration_configuration_extension, recursive=True) }}"
# matrix_registration_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_registration_restart_necessary: false

View File

@@ -63,10 +63,10 @@
force_source: "{{ matrix_registration_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_registration_docker_image_force_pull }}"
when: "not matrix_registration_container_image_self_build | bool"
register: result
register: matrix_registration_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_registration_container_image_pull_result is not failed
- name: Ensure matrix-registration repository is present when self-building
ansible.builtin.git:
@@ -106,6 +106,7 @@
mode: 0644
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_registration_config_result
- name: Ensure matrix-registration support files installed
ansible.builtin.template:
@@ -116,6 +117,7 @@
group: "{{ matrix_group_name }}"
with_items:
- labels
register: matrix_registration_support_files_result
- name: Ensure matrix-registration container network is created
community.general.docker_network:
@@ -129,6 +131,18 @@
src: "{{ role_path }}/templates/systemd/matrix-registration.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-registration.service"
mode: 0644
register: matrix_registration_systemd_service_result
- name: Determine whether matrix-registration needs a restart
ansible.builtin.set_fact:
matrix_registration_restart_necessary: >-
{{
matrix_registration_migration_requires_restart | default(false)
or matrix_registration_config_result.changed | default(false)
or matrix_registration_support_files_result.changed | default(false)
or matrix_registration_systemd_service_result.changed | default(false)
or matrix_registration_container_image_pull_result.changed | default(false)
}}
- name: Ensure matrix-registration.service restarted, if necessary
ansible.builtin.service:

View File

@@ -404,3 +404,13 @@ matrix_static_files_self_check_hostname_identity: ''
# As per the spec (https://matrix.org/docs/spec/client_server/r0.6.0#well-known-uri), it shouldn't be,
# so we default to not following redirects as well.
matrix_static_files_self_check_well_known_matrix_client_follow_redirects: none
# matrix_static_files_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_static_files_restart_necessary: false

View File

@@ -42,6 +42,7 @@
- src: "{{ role_path }}/templates/labels.j2"
dest: "{{ matrix_static_files_base_path }}/labels"
register: matrix_static_files_config_result
- name: Ensure matrix-static-files files are installed
ansible.builtin.copy:
@@ -69,6 +70,7 @@
- content: "{{ matrix_static_files_file_index_html_template }}"
dest: "{{ matrix_static_files_public_path }}/index.html"
when: "{{ matrix_static_files_file_index_html_enabled }}"
register: matrix_static_files_files_result
- name: Ensure /.well-known/matrix/server file deleted if not enabled
ansible.builtin.file:
@@ -88,10 +90,10 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_static_files_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_static_files_container_image_force_pull }}"
register: result
register: matrix_static_files_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_static_files_container_image_pull_result is not failed
- name: Ensure matrix-static-files container network is created
community.general.docker_network:
@@ -105,3 +107,14 @@
src: "{{ role_path }}/templates/systemd/matrix-static-files.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/{{ matrix_static_files_identifier }}.service"
mode: 0644
register: matrix_static_files_systemd_service_result
- name: Determine whether matrix-static-files needs a restart
ansible.builtin.set_fact:
matrix_static_files_restart_necessary: >-
{{
matrix_static_files_config_result.changed | default(false)
or matrix_static_files_files_result.changed | default(false)
or matrix_static_files_systemd_service_result.changed | default(false)
or matrix_static_files_container_image_pull_result.changed | default(false)
}}

View File

@@ -135,3 +135,13 @@ matrix_sygnal_configuration_extension: "{{ matrix_sygnal_configuration_extension
# Holds the final sygnal configuration (a combination of the default and its extension).
# You most likely don't need to touch this variable. Instead, see `matrix_sygnal_configuration_yaml`.
matrix_sygnal_configuration: "{{ matrix_sygnal_configuration_yaml | from_yaml | combine(matrix_sygnal_configuration_extension, recursive=True) }}"
# matrix_sygnal_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_sygnal_restart_necessary: false

View File

@@ -28,6 +28,7 @@
mode: 0640
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_sygnal_config_result
- name: Ensure Sygnal labels installed
ansible.builtin.template:
@@ -36,6 +37,7 @@
mode: 0640
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_sygnal_support_files_result
- name: Ensure Sygnal image is pulled
community.docker.docker_image:
@@ -43,10 +45,10 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_sygnal_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_sygnal_docker_image_force_pull }}"
register: result
register: matrix_sygnal_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_sygnal_container_image_pull_result is not failed
- name: Ensure Sygnal container network is created
community.general.docker_network:
@@ -60,3 +62,14 @@
src: "{{ role_path }}/templates/systemd/matrix-sygnal.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-sygnal.service"
mode: 0644
register: matrix_sygnal_systemd_service_result
- name: Determine whether Sygnal needs a restart
ansible.builtin.set_fact:
matrix_sygnal_restart_necessary: >-
{{
matrix_sygnal_config_result.changed | default(false)
or matrix_sygnal_support_files_result.changed | default(false)
or matrix_sygnal_systemd_service_result.changed | default(false)
or matrix_sygnal_container_image_pull_result.changed | default(false)
}}

View File

@@ -248,3 +248,13 @@ matrix_synapse_admin_config_asManagedUsers_custom: [] # noqa var-naming
# Example for mautrix-telegram: ["^@telegram_[a-zA-Z0-9]+:example\\.com$"]
# WARNING: you want to use matrix_synapse_admin_config_asManagedUsers_custom instead of this variable.
matrix_synapse_admin_config_asManagedUsers: "{{ matrix_synapse_admin_config_asManagedUsers_auto + matrix_synapse_admin_config_asManagedUsers_custom }}" # noqa var-naming
# matrix_synapse_admin_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_synapse_admin_restart_necessary: false

View File

@@ -31,6 +31,7 @@
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
mode: 0640
register: matrix_synapse_admin_support_files_result
- name: Ensure matrix-synapse-admin configuration installed
ansible.builtin.copy:
@@ -39,6 +40,7 @@
mode: 0644
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_synapse_admin_config_result
- name: Ensure matrix-synapse-admin image is pulled
community.docker.docker_image:
@@ -47,10 +49,10 @@
force_source: "{{ matrix_synapse_admin_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_synapse_admin_docker_image_force_pull }}"
when: not matrix_synapse_admin_container_image_self_build | bool
register: result
register: matrix_synapse_admin_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_synapse_admin_container_image_pull_result is not failed
- name: Ensure matrix-synapse-admin repository is present when self-building
ansible.builtin.git:
@@ -87,3 +89,14 @@
src: "{{ role_path }}/templates/systemd/matrix-synapse-admin.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-synapse-admin.service"
mode: 0644
register: matrix_synapse_admin_systemd_service_result
- name: Determine whether Synapse Admin needs a restart
ansible.builtin.set_fact:
matrix_synapse_admin_restart_necessary: >-
{{
matrix_synapse_admin_support_files_result.changed | default(false)
or matrix_synapse_admin_config_result.changed | default(false)
or matrix_synapse_admin_systemd_service_result.changed | default(false)
or matrix_synapse_admin_container_image_pull_result.changed | default(false)
}}

View File

@@ -87,3 +87,13 @@ matrix_synapse_auto_compressor_command: "synapse_auto_compressor -p $POSTGRES_LO
# Controls the POSTGRES_LOCATION environment variable
matrix_synapse_auto_compressor_environment_variable_postgres_location: "{{ matrix_synapse_auto_compressor_synapse_database }}"
# matrix_synapse_auto_compressor_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_synapse_auto_compressor_restart_necessary: false

View File

@@ -27,6 +27,7 @@
mode: 0640
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_synapse_auto_compressor_config_env_result
- name: Ensure synapse-auto-compressor workaround script is installed
ansible.builtin.template:
@@ -35,6 +36,7 @@
mode: 0750
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_synapse_auto_compressor_config_script_result
- name: Ensure synapse-auto-compressor image is pulled
community.docker.docker_image:
@@ -43,10 +45,10 @@
force_source: "{{ matrix_synapse_auto_compressor_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_synapse_auto_compressor_container_image_force_pull }}"
when: "not matrix_synapse_auto_compressor_container_image_self_build | bool"
register: result
register: matrix_synapse_auto_compressor_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_synapse_auto_compressor_container_image_pull_result is not failed
- when: "matrix_synapse_auto_compressor_container_image_self_build | bool"
@@ -97,3 +99,14 @@
with_items:
- service
- timer
register: matrix_synapse_auto_compressor_systemd_service_result
- name: Determine whether synapse-auto-compressor needs a restart
ansible.builtin.set_fact:
matrix_synapse_auto_compressor_restart_necessary: >-
{{
matrix_synapse_auto_compressor_config_env_result.changed | default(false)
or matrix_synapse_auto_compressor_config_script_result.changed | default(false)
or matrix_synapse_auto_compressor_systemd_service_result.changed | default(false)
or matrix_synapse_auto_compressor_container_image_pull_result.changed | default(false)
}}

View File

@@ -361,3 +361,13 @@ matrix_synapse_reverse_proxy_companion_whoami_sync_worker_router_debug_headers_e
# /Whoami-based sync worker routing #
# #
########################################################################################
# matrix_synapse_reverse_proxy_companion_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_synapse_reverse_proxy_companion_restart_necessary: false

View File

@@ -34,6 +34,7 @@
dest: "{{ matrix_synapse_reverse_proxy_companion_confd_path }}/matrix-synapse-reverse-proxy-companion.conf"
- src: "{{ role_path }}/templates/labels.j2"
dest: "{{ matrix_synapse_reverse_proxy_companion_base_path }}/labels"
register: matrix_synapse_reverse_proxy_companion_config_result
- name: Ensure matrix-synapse-reverse-proxy-companion whoami sync worker router njs script is deployed
ansible.builtin.template:
@@ -56,10 +57,10 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_synapse_reverse_proxy_companion_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_synapse_reverse_proxy_companion_container_image_force_pull }}"
register: result
register: matrix_synapse_reverse_proxy_companion_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_synapse_reverse_proxy_companion_container_image_pull_result is not failed
- name: Ensure matrix-synapse-reverse-proxy-companion container network is created
community.general.docker_network:
@@ -73,3 +74,13 @@
src: "{{ role_path }}/templates/systemd/matrix-synapse-reverse-proxy-companion.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-synapse-reverse-proxy-companion.service"
mode: 0644
register: matrix_synapse_reverse_proxy_companion_systemd_service_result
- name: Determine whether Synapse reverse-proxy companion needs a restart
ansible.builtin.set_fact:
matrix_synapse_reverse_proxy_companion_restart_necessary: >-
{{
matrix_synapse_reverse_proxy_companion_config_result.changed | default(false)
or matrix_synapse_reverse_proxy_companion_systemd_service_result.changed | default(false)
or matrix_synapse_reverse_proxy_companion_container_image_pull_result.changed | default(false)
}}

View File

@@ -90,3 +90,13 @@ matrix_synapse_usage_exporter_container_labels_additional_labels: ''
# If the Grafana role is enabled, these dashboards will be downloaded.
matrix_synapse_usage_exporter_dashboard_urls:
- https://raw.githubusercontent.com/spantaleev/matrix-docker-ansible-deploy/master/roles/custom/matrix-synapse-usage-exporter/templates/grafana/synapse-usage-exporter.json
# matrix_synapse_usage_exporter_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_synapse_usage_exporter_restart_necessary: false

View File

@@ -29,6 +29,7 @@
with_items:
- env
- labels
register: matrix_synapse_usage_exporter_support_files_result
- name: Ensure synapse-usage-exporter Docker image is pulled
community.docker.docker_image:
@@ -37,10 +38,10 @@
force_source: "{{ matrix_synapse_usage_exporter_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_synapse_usage_exporter_container_image_force_pull }}"
when: "not matrix_synapse_usage_exporter_container_image_self_build | bool"
register: result
register: matrix_synapse_usage_exporter_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_synapse_usage_exporter_container_image_pull_result is not failed
- when: "matrix_synapse_usage_exporter_container_image_self_build | bool"
block:
@@ -81,3 +82,13 @@
src: "{{ role_path }}/templates/systemd/matrix-synapse-usage-exporter.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/{{ matrix_synapse_usage_exporter_identifier }}.service"
mode: 0640
register: matrix_synapse_usage_exporter_systemd_service_result
- name: Determine whether synapse-usage-exporter needs a restart
ansible.builtin.set_fact:
matrix_synapse_usage_exporter_restart_necessary: >-
{{
matrix_synapse_usage_exporter_support_files_result.changed | default(false)
or matrix_synapse_usage_exporter_systemd_service_result.changed | default(false)
or matrix_synapse_usage_exporter_container_image_pull_result.changed | default(false)
}}

View File

@@ -85,3 +85,13 @@ matrix_user_verification_service_uvs_openid_verify_server_name: "{{ matrix_domai
# Log level
# See choices here: https://github.com/winstonjs/winston#logging-levels
matrix_user_verification_service_uvs_log_level: info
# matrix_user_verification_service_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_user_verification_service_restart_necessary: false

View File

@@ -24,10 +24,10 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_user_verification_service_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_user_verification_service_docker_image_force_pull }}"
register: result
register: matrix_user_verification_service_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed
until: matrix_user_verification_service_container_image_pull_result is not failed
when: "not matrix_user_verification_service_container_image_self_build | bool"
- name: Ensure Matrix User Verification Service repository is present when self-building
@@ -60,6 +60,7 @@
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
mode: 0644
register: matrix_user_verification_service_config_result
- name: Ensure matrix-user-verification-service container network is created
community.general.docker_network:
@@ -73,3 +74,13 @@
src: "{{ role_path }}/templates/systemd/matrix-user-verification-service.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/{{ matrix_user_verification_service_systemd_service_name }}"
mode: 0644
register: matrix_user_verification_service_systemd_service_result
- name: Determine whether Matrix User Verification Service needs a restart
ansible.builtin.set_fact:
matrix_user_verification_service_restart_necessary: >-
{{
matrix_user_verification_service_config_result.changed | default(false)
or matrix_user_verification_service_systemd_service_result.changed | default(false)
or matrix_user_verification_service_container_image_pull_result.changed | default(false)
}}