Matrix Docker Ansible eploy
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 

52 righe
2.4 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=Matrix registration bot
  8. {% for service in matrix_bot_matrix_registration_bot_systemd_required_services_list %}
  9. Requires={{ service }}
  10. After={{ service }}
  11. {% endfor %}
  12. {% for service in matrix_bot_matrix_registration_bot_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_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-bot-matrix-registration-bot 2>/dev/null || true'
  20. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-bot-matrix-registration-bot 2>/dev/null || true'
  21. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  22. --rm \
  23. --name=matrix-bot-matrix-registration-bot \
  24. --log-driver=none \
  25. --cap-drop=ALL \
  26. -e "CONFIG_PATH=/config/config.yml" \
  27. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  28. --read-only \
  29. --mount type=bind,src={{ matrix_bot_matrix_registration_bot_config_path }},dst=/config,ro \
  30. --mount type=bind,src={{ matrix_bot_matrix_registration_bot_data_path }},dst=/data \
  31. --network={{ matrix_bot_matrix_registration_bot_container_network }} \
  32. {{ matrix_bot_matrix_registration_bot_docker_image }}
  33. {% for network in matrix_bot_matrix_registration_bot_container_additional_networks %}
  34. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bot-matrix-registration-bot
  35. {% endfor %}
  36. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-bot-matrix-registration-bot
  37. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-bot-matrix-registration-bot 2>/dev/null || true'
  38. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-bot-matrix-registration-bot 2>/dev/null || true'
  39. Restart=always
  40. RestartSec=30
  41. SyslogIdentifier=matrix-bot-matrix-registration-bot
  42. [Install]
  43. WantedBy=multi-user.target