Matrix Docker Ansible eploy
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

47 linhas
1.7 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=matrix-prometheus-node-exporter
  4. {% for service in matrix_prometheus_node_exporter_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_prometheus_node_exporter_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-prometheus-node-exporter 2>/dev/null'
  17. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-prometheus-node-exporter 2>/dev/null'
  18. ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-prometheus-node-exporter \
  19. --log-driver=none \
  20. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  21. --cap-drop=ALL \
  22. --read-only \
  23. {% if matrix_prometheus_node_exporter_container_http_host_bind_port %}
  24. -p {{ matrix_prometheus_node_exporter_container_http_host_bind_port }}:9100 \
  25. {% endif %}
  26. {% for arg in matrix_prometheus_node_exporter_container_extra_arguments %}
  27. {{ arg }} \
  28. {% endfor %}
  29. --net=host \
  30. --pid=host \
  31. --mount type=bind,src=/,dst=/host,ro,bind-propagation=rslave \
  32. {{ matrix_prometheus_node_exporter_docker_image }} \
  33. --path.rootfs=/host
  34. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} stop matrix-prometheus-node-exporter 2>/dev/null'
  35. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-prometheus-node-exporter 2>/dev/null'
  36. Restart=always
  37. RestartSec=30
  38. SyslogIdentifier=matrix-prometheus-node-exporter
  39. [Install]
  40. WantedBy=matrix.target