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.
 
 

50 line
2.2 KiB

  1. #jinja2: lstrip_blocks: True
  2. [Unit]
  3. Description=Matrix web forms bot
  4. {% for service in matrix_bot_buscarron_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_bot_buscarron_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_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-bot-buscarron 2>/dev/null || true'
  16. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-bot-buscarron 2>/dev/null || true'
  17. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  18. --rm \
  19. --name=matrix-bot-buscarron \
  20. --log-driver=none \
  21. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  22. --cap-drop=ALL \
  23. --read-only \
  24. --network={{ matrix_bot_buscarron_container_network }} \
  25. --env-file={{ matrix_bot_buscarron_config_path }}/env \
  26. --label-file={{ matrix_bot_buscarron_config_path }}/labels \
  27. --mount type=bind,src={{ matrix_bot_buscarron_data_path }},dst=/data \
  28. {% for arg in matrix_bot_buscarron_container_extra_arguments %}
  29. {{ arg }} \
  30. {% endfor %}
  31. {{ matrix_bot_buscarron_container_image }}
  32. {% for network in matrix_bot_buscarron_container_additional_networks %}
  33. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bot-buscarron
  34. {% endfor %}
  35. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-bot-buscarron
  36. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-bot-buscarron 2>/dev/null || true'
  37. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-bot-buscarron 2>/dev/null || true'
  38. Restart=always
  39. RestartSec=30
  40. SyslogIdentifier=matrix-bot-buscarron
  41. [Install]
  42. WantedBy=multi-user.target