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

30 lines
913 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
{% endif %}
[Service]
EnvironmentFile=-/etc/environment
ExecStartPre=-/usr/bin/{{ container_binary }} rm -f node-exporter
ExecStart=/usr/bin/{{ container_binary }} run --name=node-exporter \
-v /proc:/host/proc:ro -v /sys:/host/sys:ro \
--net=host \
--path.procfs=/host/proc \
--path.sysfs=/host/sys \
--no-collector.timex \
{{ node_exporter_container_image }}
# Make sure the cfg80211 is loaded before running the container, the node
# exporter needs this module loaded to test for presence of wi-fi devices
ExecStartPre=/usr/sbin/modprobe cfg80211
ExecStop=-/usr/bin/{{ container_binary }} stop node-exporter
Restart=always
RestartSec=10s
TimeoutStartSec=120
TimeoutStopSec=15
[Install]
WantedBy=multi-user.target