mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2024-11-07 11:17:34 +01:00
c10182e5a6
With this change, the following roles are now only dependent on the minimal `matrix-base` role: - `matrix-corporal` - `matrix-coturn` - `matrix-mailer` - `matrix-mxisd` - `matrix-postgres` - `matrix-riot-web` - `matrix-synapse` The `matrix-nginx-proxy` role still does too much and remains dependent on the others. Wiring up the various (now-independent) roles happens via a glue variables file (`group_vars/matrix-servers`). It's triggered for all hosts in the `matrix-servers` group. According to Ansible's rules of priority, we have the following chain of inclusion/overriding now: - role defaults (mostly empty or good for independent usage) - playbook glue variables (`group_vars/matrix-servers`) - inventory host variables (`inventory/host_vars/matrix.<your-domain>`) All roles default to enabling their main component (e.g. `matrix_mxisd_enabled: true`, `matrix_riot_web_enabled: true`). Reasoning: if a role is included in a playbook (especially separately, in another playbook), it should "work" by default. Our playbook disables some of those if they are not generally useful (e.g. `matrix_corporal_enabled: false`).
46 lines
1.6 KiB
Django/Jinja
46 lines
1.6 KiB
Django/Jinja
[Unit]
|
|
Description=Matrix Synapse server
|
|
{% for service in matrix_synapse_systemd_required_services_list %}
|
|
Requires={{ service }}
|
|
After={{ service }}
|
|
{% endfor %}
|
|
{% for service in matrix_synapse_systemd_wanted_services_list %}
|
|
Wants={{ service }}
|
|
{% endfor %}
|
|
|
|
[Service]
|
|
Type=simple
|
|
ExecStartPre=-/usr/bin/docker kill matrix-synapse
|
|
ExecStartPre=-/usr/bin/docker rm matrix-synapse
|
|
{% if matrix_s3_media_store_enabled %}
|
|
# Allow for some time before starting, so that media store can mount.
|
|
# Mounting can happen later too, but if we start writing,
|
|
# we'd write files to the local filesystem and fusermount will complain.
|
|
ExecStartPre=/bin/sleep 5
|
|
{% endif %}
|
|
ExecStart=/usr/bin/docker run --rm --name matrix-synapse \
|
|
--log-driver=none \
|
|
--network={{ matrix_docker_network }} \
|
|
-e SYNAPSE_CONFIG_PATH=/data/homeserver.yaml \
|
|
-e SYNAPSE_CACHE_FACTOR={{ matrix_synapse_cache_factor }} \
|
|
{% if matrix_synapse_federation_enabled %}
|
|
-p 8448:8448 \
|
|
{% endif %}
|
|
{% if matrix_synapse_container_expose_client_server_api_port %}
|
|
-p 127.0.0.1:8008:8008 \
|
|
{% endif %}
|
|
-v {{ matrix_synapse_config_dir_path }}:/data \
|
|
-v {{ matrix_synapse_run_path }}:/matrix-run \
|
|
-v {{ matrix_synapse_base_path }}/storage:/matrix-media-store-parent:slave \
|
|
{% for volume in matrix_synapse_container_additional_volumes %}
|
|
-v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \
|
|
{% endfor %}
|
|
{{ matrix_synapse_docker_image }}
|
|
ExecStop=-/usr/bin/docker kill matrix-synapse
|
|
ExecStop=-/usr/bin/docker rm matrix-synapse
|
|
Restart=always
|
|
RestartSec=30
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|