Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

54 lines
2.3 KiB

  1. {#
  2. SPDX-FileCopyrightText: 2024 MDAD Team and contributors
  3. SPDX-License-Identifier: AGPL-3.0-or-later
  4. #}
  5. #jinja2: lstrip_blocks: "True"
  6. [Unit]
  7. Description=A bridge between Matrix and multiple project management services, such as GitHub, GitLab and JIRA.
  8. {% for service in matrix_hookshot_systemd_required_services_list %}
  9. Requires={{ service }}
  10. After={{ service }}
  11. {% endfor %}
  12. {% for service in matrix_hookshot_systemd_wanted_services_list %}
  13. Wants={{ service }}
  14. {% endfor %}
  15. DefaultDependencies=no
  16. [Service]
  17. Type=simple
  18. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  19. ExecStartPre=-{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ matrix_hookshot_identifier }}
  20. ExecStartPre=-{{ devture_systemd_docker_base_host_command_docker }} rm {{ matrix_hookshot_identifier }}
  21. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create --rm --name {{ matrix_hookshot_identifier }} \
  22. --log-driver=none \
  23. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  24. --cap-drop=ALL \
  25. --network={{ matrix_hookshot_container_network }} \
  26. --mount type=bind,src={{ matrix_hookshot_base_path }},dst=/data \
  27. --label-file={{ matrix_hookshot_base_path }}/labels \
  28. {% for port in matrix_hookshot_container_http_host_bind_ports %}
  29. -p {{ port }} \
  30. {% endfor %}
  31. {% for arg in matrix_hookshot_container_extra_arguments %}
  32. {{ arg }} \
  33. {% endfor %}
  34. {{ matrix_hookshot_docker_image }}
  35. {% for network in matrix_hookshot_container_additional_networks %}
  36. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ matrix_hookshot_identifier }}
  37. {% endfor %}
  38. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ matrix_hookshot_identifier }}
  39. ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ matrix_hookshot_identifier }}
  40. ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} rm {{ matrix_hookshot_identifier }}
  41. Restart=always
  42. RestartSec=30
  43. SyslogIdentifier={{ matrix_hookshot_identifier }}
  44. [Install]
  45. WantedBy=multi-user.target