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.
 
 
 

43 lines
1.5 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=Maubot
  4. {% for service in matrix_bot_maubot_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_bot_maubot_systemd_wanted_services_list %}
  9. Wants={{ service }}
  10. {% endfor %}
  11. DefaultDependencies=no
  12. [Service]
  13. Type=simple
  14. Environment="HOME={{ matrix_systemd_unit_home_path }}"
  15. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-bot-maubot 2>/dev/null || true'
  16. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-bot-maubot 2>/dev/null || true'
  17. ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-bot-maubot \
  18. --log-driver=none \
  19. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  20. --read-only \
  21. --cap-drop=ALL \
  22. -v {{ matrix_bot_maubot_data_path }}:/data:z \
  23. {% for arg in matrix_bot_maubot_container_extra_arguments %}
  24. {{ arg }} \
  25. {% endfor %}
  26. --network={{ matrix_docker_network }} \
  27. {% for port in matrix_bot_maubot_management_interface_http_bind_port %}
  28. -p {{ port }} \
  29. {% endfor %}
  30. {{ matrix_bot_maubot_docker_image }} \
  31. python3 -m maubot -c /data/config.yaml
  32. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-bot-maubot 2>/dev/null || true'
  33. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-bot-maubot 2>/dev/null || true'
  34. Restart=always
  35. RestartSec=30
  36. SyslogIdentifier=matrix-bot-maubot
  37. [Install]
  38. WantedBy=multi-user.target