ceph-ansible/roles/ceph-node-exporter/templates/node_exporter.service.j2

31 lines
827 B
Django/Jinja

# This file is managed by ansible, don't make changes here - they will be
# overwritten.
[Unit]
Description=Node Exporter
{% if container_binary == 'docker' %}
After=docker.service
{% else %}
After=network.target
{% endif %}
[Service]
EnvironmentFile=-/etc/environment
ExecStartPre=-/usr/bin/{{ container_binary }} rm -f node-exporter
ExecStart=/usr/bin/{{ container_binary }} run --rm --name=node-exporter \
--privileged \
-v /proc:/host/proc:ro -v /sys:/host/sys:ro \
--net=host \
{{ node_exporter_container_image }} \
--path.procfs=/host/proc \
--path.sysfs=/host/sys \
--no-collector.timex \
--web.listen-address=:{{ node_exporter_port }}
ExecStop=-/usr/bin/{{ container_binary }} stop node-exporter
Restart=always
RestartSec=10s
TimeoutStartSec=120
TimeoutStopSec=15
[Install]
WantedBy=multi-user.target