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.
 
 

47 line
2.2 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=A bridge between Matrix and multiple project management services, such as GitHub, GitLab and JIRA.
  4. {% for service in matrix_hookshot_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_hookshot_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 --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ matrix_hookshot_container_ident }}
  16. ExecStartPre=-{{ devture_systemd_docker_base_host_command_docker }} rm {{ matrix_hookshot_container_ident }}
  17. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create --rm --name {{ matrix_hookshot_container_ident }} \
  18. --log-driver=none \
  19. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  20. --cap-drop=ALL \
  21. --network={{ matrix_hookshot_container_network }} \
  22. --mount type=bind,src={{ matrix_hookshot_base_path }},dst=/data \
  23. {% for port in matrix_hookshot_container_http_host_bind_ports %}
  24. -p {{ port }} \
  25. {% endfor %}
  26. {% for arg in matrix_hookshot_container_extra_arguments %}
  27. {{ arg }} \
  28. {% endfor %}
  29. {{ matrix_hookshot_docker_image }}
  30. {% if matrix_hookshot_container_additional_networks %}
  31. {% for network in matrix_hookshot_container_additional_networks %}ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network ]] {{ matrix_hookshot_container_ident }}{% endfor %}
  32. {% endif %}
  33. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ matrix_hookshot_container_ident }}
  34. ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ matrix_hookshot_container_ident }}
  35. ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} rm {{ matrix_hookshot_container_ident }}
  36. Restart=always
  37. RestartSec=30
  38. SyslogIdentifier={{ matrix_hookshot_container_ident }}
  39. [Install]
  40. WantedBy=multi-user.target