Add support for matrix_dimension_systemd_{required,wanted}_services_list

We were referencing them from `group_vars/matrix_servers` since
recently, but there were no such variables and they weren't being put to
use.
This commit is contained in:
Slavi Pantaleev 2020-12-14 20:31:07 +02:00
parent 374f43735a
commit 0790a7b2a8
2 changed files with 13 additions and 2 deletions

View file

@ -15,6 +15,12 @@ matrix_dimension_base_path: "{{ matrix_base_data_path }}/dimension"
matrix_dimension_docker_image: "docker.io/turt2live/matrix-dimension:latest" matrix_dimension_docker_image: "docker.io/turt2live/matrix-dimension:latest"
matrix_dimension_docker_image_force_pull: "{{ matrix_dimension_docker_image.endswith(':latest') }}" matrix_dimension_docker_image_force_pull: "{{ matrix_dimension_docker_image.endswith(':latest') }}"
# List of systemd services that matrix-dimension.service depends on.
matrix_dimension_systemd_required_services_list: ['docker.service']
# List of systemd services that matrix-dimension.service wants
matrix_dimension_systemd_wanted_services_list: []
# The user and group id correspond to the node user in the `turt2live/matrix-dimension` image. # The user and group id correspond to the node user in the `turt2live/matrix-dimension` image.
matrix_dimension_user_uid: '1000' matrix_dimension_user_uid: '1000'
matrix_dimension_user_gid: '1000' matrix_dimension_user_gid: '1000'

View file

@ -1,8 +1,13 @@
#jinja2: lstrip_blocks: "True" #jinja2: lstrip_blocks: "True"
[Unit] [Unit]
Description=Matrix Dimension Description=Matrix Dimension
After=docker.service {% for service in matrix_dimension_systemd_required_services_list %}
Requires=docker.service Requires={{ service }}
After={{ service }}
{% endfor %}
{% for service in matrix_dimension_systemd_wanted_services_list %}
Wants={{ service }}
{% endfor %}
DefaultDependencies=no DefaultDependencies=no
[Service] [Service]