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.
 
 

61 lines
2.2 KiB

  1. #jinja2: lstrip_blocks: True
  2. [Unit]
  3. Description=a bouncer-style Matrix IRC bridge
  4. {% for service in matrix_heisenbridge_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_heisenbridge_systemd_wanted_services_list %}
  9. Wants={{ service }}
  10. {% endfor %}
  11. DefaultDependencies=no
  12. [Service]
  13. Type=simple
  14. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  15. ExecStartPre=-{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ matrix_heisenbridge_container_stop_grace_time_seconds }} matrix-heisenbridge
  16. ExecStartPre=-{{ devture_systemd_docker_base_host_command_docker }} rm matrix-heisenbridge
  17. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  18. --rm \
  19. --name=matrix-heisenbridge \
  20. --log-driver=none \
  21. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  22. --cap-drop=ALL \
  23. --network={{ matrix_heisenbridge_container_network }} \
  24. {% if matrix_heisenbridge_identd_enabled %}
  25. -p 113:13113 \
  26. {% endif %}
  27. --mount type=bind,src={{ matrix_heisenbridge_base_path }},dst=/config \
  28. --label-file={{ matrix_heisenbridge_base_path }}/labels \
  29. {% for arg in matrix_heisenbridge_container_extra_arguments %}
  30. {{ arg }} \
  31. {% endfor %}
  32. {{ matrix_heisenbridge_docker_image }} \
  33. {% if matrix_heisenbridge_identd_enabled %}
  34. --identd \
  35. --identd-port 13113 \
  36. {% endif %}
  37. {% if matrix_heisenbridge_owner %}
  38. -o {{ matrix_heisenbridge_owner }} \
  39. {% endif %}
  40. --config /config/registration.yaml \
  41. --listen-address 0.0.0.0 \
  42. --listen-port 9898 \
  43. {{ matrix_heisenbridge_homeserver_url }}
  44. {% for network in matrix_heisenbridge_container_additional_networks %}
  45. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-heisenbridge
  46. {% endfor %}
  47. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-heisenbridge
  48. ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ matrix_heisenbridge_container_stop_grace_time_seconds }} matrix-heisenbridge
  49. ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} rm matrix-heisenbridge
  50. Restart=always
  51. RestartSec=30
  52. SyslogIdentifier=matrix-heisenbridge
  53. [Install]
  54. WantedBy=multi-user.target