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.
 
 
 

53 lines
2.0 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=Matrix Mautrix Hangouts bridge
  4. {% for service in matrix_mautrix_hangouts_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_mautrix_hangouts_systemd_wanted_services_list %}
  9. Wants={{ service }}
  10. {% endfor %}
  11. DefaultDependencies=no
  12. [Service]
  13. Type=simple
  14. ExecStartPre=-{{ matrix_host_command_docker }} kill matrix-mautrix-hangouts matrix-mautrix-hangouts-db
  15. ExecStartPre=-{{ matrix_host_command_docker }} rm matrix-mautrix-hangouts matrix-mautrix-hangouts-db
  16. ExecStartPre={{ matrix_host_command_docker }} run --rm --name matrix-mautrix-hangouts-db \
  17. --log-driver=none \
  18. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  19. --cap-drop=ALL \
  20. -v {{ matrix_mautrix_hangouts_config_path }}:/config:z \
  21. -v {{ matrix_mautrix_hangouts_data_path }}:/data:z \
  22. {{ matrix_mautrix_hangouts_docker_image }} \
  23. alembic -x config=/config/config.yaml upgrade head
  24. # Intentional delay, so that the homeserver (we likely depend on) can manage to start.
  25. ExecStartPre={{ matrix_host_command_sleep }} 5
  26. ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-mautrix-hangouts \
  27. --log-driver=none \
  28. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  29. --cap-drop=ALL \
  30. --network={{ matrix_docker_network }} \
  31. {% if matrix_mautrix_hangouts_container_http_host_bind_port %}
  32. -p {{ matrix_mautrix_hangouts_container_http_host_bind_port }}:8080 \
  33. {% endif %}
  34. -v {{ matrix_mautrix_hangouts_config_path }}:/config:z \
  35. -v {{ matrix_mautrix_hangouts_data_path }}:/data:z \
  36. {% for arg in matrix_mautrix_hangouts_container_extra_arguments %}
  37. {{ arg }} \
  38. {% endfor %}
  39. {{ matrix_mautrix_hangouts_docker_image }} \
  40. python3 -m mautrix_hangouts -c /config/config.yaml
  41. ExecStop=-{{ matrix_host_command_docker }} kill matrix-mautrix-hangouts
  42. ExecStop=-{{ matrix_host_command_docker }} rm matrix-mautrix-hangouts
  43. Restart=always
  44. RestartSec=30
  45. SyslogIdentifier=matrix-mautrix-hangouts
  46. [Install]
  47. WantedBy=multi-user.target