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 rivejä
2.6 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description={{ matrix_prometheus_nginxlog_exporter_container_hostname }}
  4. {% for service in matrix_prometheus_nginxlog_exporter_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_prometheus_nginxlog_exporter_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 }} kill {{ matrix_prometheus_nginxlog_exporter_container_hostname }} 2>/dev/null || true'
  16. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ matrix_prometheus_nginxlog_exporter_container_hostname }} 2>/dev/null || true'
  17. ExecStart={{ devture_systemd_docker_base_host_command_docker }} run --rm --name {{ matrix_prometheus_nginxlog_exporter_container_hostname }} \
  18. --log-driver=none \
  19. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  20. --cap-drop=ALL \
  21. --read-only \
  22. --network={{ matrix_prometheus_nginxlog_exporter_container_network }} \
  23. {% if matrix_prometheus_nginxlog_exporter_container_http_host_bind_port %}
  24. -p {{ matrix_prometheus_nginxlog_exporter_container_http_host_bind_port }}:{{ matrix_prometheus_nginxlog_exporter_container_metrics_port }} \
  25. {% endif %}
  26. {% if matrix_prometheus_nginxlog_exporter_container_syslog_host_bind_port %}
  27. -p {{ matrix_prometheus_nginxlog_exporter_container_syslog_host_bind_port }}:{{ matrix_prometheus_nginxlog_exporter_container_syslog_port }}/udp \
  28. {% endif %}
  29. -v {{ matrix_prometheus_nginxlog_exporter_config_path }}:/etc/prometheus-nginxlog-exporter:z \
  30. {% for arg in matrix_prometheus_nginxlog_exporter_container_extra_arguments %}
  31. {{ arg }} \
  32. {% endfor %}
  33. {{ matrix_prometheus_nginxlog_exporter_docker_image }} \
  34. -config-file /etc/prometheus-nginxlog-exporter/prometheus-nginxlog-exporter.yaml
  35. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill {{ matrix_prometheus_nginxlog_exporter_container_hostname }} 2>/dev/null || true'
  36. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ matrix_prometheus_nginxlog_exporter_container_hostname }} 2>/dev/null || true'
  37. Restart=always
  38. RestartSec=30
  39. SyslogIdentifier={{ matrix_prometheus_nginxlog_exporter_container_hostname }}
  40. [Install]
  41. WantedBy=multi-user.target