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.
 
 
 

46 lines
1.5 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=matrix-grafana
  4. {% for service in matrix_grafana_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_grafana_systemd_wanted_services_list %}
  9. Wants={{ service }}
  10. {% endfor %}
  11. DefaultDependencies=no
  12. PartOf=matrix.target
  13. [Service]
  14. Type=simple
  15. Environment="HOME={{ matrix_systemd_unit_home_path }}"
  16. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} stop matrix-grafana 2>/dev/null'
  17. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-grafana 2>/dev/null'
  18. ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-grafana \
  19. --log-driver=none \
  20. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  21. --cap-drop=ALL \
  22. --read-only \
  23. --network={{ matrix_docker_network }} \
  24. {% if matrix_grafana_container_http_host_bind_port %}
  25. -p {{ matrix_grafana_container_http_host_bind_port }}:3000 \
  26. {% endif %}
  27. -v {{ matrix_grafana_config_path }}:/etc/grafana:z \
  28. -v {{ matrix_grafana_data_path }}:/var/lib/grafana:z \
  29. {% for arg in matrix_grafana_container_extra_arguments %}
  30. {{ arg }} \
  31. {% endfor %}
  32. {{ matrix_grafana_docker_image }}
  33. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} stop matrix-grafana 2>/dev/null'
  34. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-grafana 2>/dev/null'
  35. Restart=always
  36. RestartSec=30
  37. SyslogIdentifier=matrix-grafana
  38. [Install]
  39. WantedBy=matrix.target