mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-03-25 22:17:25 +00:00
Add conditional restart support to matrix-goofys
Register image pull, env, and systemd service results, compute matrix_goofys_restart_necessary, and wire it into group_vars/matrix_servers instead of hardcoding restart_necessary: true. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -843,7 +843,7 @@ devture_systemd_service_manager_services_list_auto: |
|
||||
([{
|
||||
'name': 'matrix-goofys.service',
|
||||
'priority': 800,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_goofys_restart_necessary | bool),
|
||||
'groups': ['matrix', 'goofys'],
|
||||
}] if (matrix_synapse_enabled and matrix_s3_media_store_enabled) else [])
|
||||
+
|
||||
|
||||
@@ -1648,6 +1648,16 @@ matrix_s3_media_store_aws_secret_key: "your-aws-secret-key"
|
||||
matrix_s3_media_store_region: "eu-central-1"
|
||||
matrix_s3_media_store_path: "{{ matrix_synapse_media_store_path }}"
|
||||
|
||||
# matrix_goofys_restart_necessary controls whether the Goofys 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_goofys_restart_necessary: false
|
||||
|
||||
# Controls whether the self-check feature should validate SSL certificates.
|
||||
matrix_synapse_self_check_validate_certificates: true
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_s3_goofys_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_s3_goofys_container_image_force_pull }}"
|
||||
register: result
|
||||
register: matrix_goofys_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_goofys_container_image_pull_result is not failed
|
||||
|
||||
# This will throw a Permission Denied error if already mounted
|
||||
- name: Check Matrix Goofys external storage mountpoint path
|
||||
@@ -47,9 +47,20 @@
|
||||
dest: "{{ matrix_synapse_config_dir_path }}/env-goofys"
|
||||
owner: root
|
||||
mode: '0600'
|
||||
register: matrix_goofys_env_result
|
||||
|
||||
- name: Ensure matrix-goofys.service installed
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/goofys/systemd/matrix-goofys.service.j2"
|
||||
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-goofys.service"
|
||||
mode: '0644'
|
||||
register: matrix_goofys_systemd_service_result
|
||||
|
||||
- name: Determine whether Goofys needs a restart
|
||||
ansible.builtin.set_fact:
|
||||
matrix_goofys_restart_necessary: >-
|
||||
{{
|
||||
matrix_goofys_env_result.changed | default(false)
|
||||
or matrix_goofys_systemd_service_result.changed | default(false)
|
||||
or matrix_goofys_container_image_pull_result.changed | default(false)
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user