mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-06-30 03:50:30 +03:00
ee1cd217a8
Adds optional support for running the playbook on Synology DSM 7+, detected automatically via /etc/synoinfo.conf so that non-Synology hosts are unaffected. Includes DSM-native user/group management (synouser/synogroup), a requests version constraint for Docker SDK compatibility, and a boot-fix service that re-shares the volume mount and starts matrix services skipped by DSM's boot ordering. The shared-mount volume path is configurable via matrix_base_synology_volume_path, and the make-shared step only runs when the volume is not already shared. Co-authored-by: CKSit <sitchiuki@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
35 lines
1.7 KiB
YAML
35 lines
1.7 KiB
YAML
# SPDX-FileCopyrightText: 2026 Chiu Ki Sit
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
---
|
|
|
|
- name: Ensure requests Python package is constrained for Docker SDK compatibility (Synology)
|
|
ansible.builtin.pip:
|
|
name: "{{ matrix_base_synology_requests_version_constraint }}"
|
|
state: present
|
|
|
|
# Determine whether the volume is already a shared mount, so that the
|
|
# make-shared command below only runs (and only reports `changed`) when it
|
|
# actually needs to. We read /proc/self/mountinfo (always present on Linux)
|
|
# and look for the ` shared:` optional tag on the volume's mount point line.
|
|
# grep exits non-zero on no-match or any error, so the make-shared command is
|
|
# skipped only when shared propagation is positively confirmed; every other
|
|
# case falls through to running it (which is idempotent).
|
|
- name: Determine current mount propagation of the Synology volume
|
|
ansible.builtin.command: grep -E ' {{ matrix_base_synology_volume_path }} .* shared:' /proc/self/mountinfo
|
|
register: matrix_base_synology_volume_propagation
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
# Run immediately during setup so matrix services can start without a manual
|
|
# step. The boot-fix service handles this on every subsequent reboot.
|
|
# noqa command-instead-of-module: ansible.builtin.mount does not support
|
|
# changing mount propagation (--make-shared); command is the only option here.
|
|
- name: Ensure the Synology volume has shared mount propagation
|
|
ansible.builtin.command: mount --make-shared {{ matrix_base_synology_volume_path }} # noqa command-instead-of-module
|
|
when: matrix_base_synology_volume_propagation.rc != 0
|
|
changed_when: true
|
|
|
|
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_synology_boot_fix.yml"
|