ansible-ffibk/roles/service-fastd-mesh/templates/fastd-exporter.service.j2
2018-09-25 10:38:41 +02:00

20 lines
916 B
Django/Jinja

[Unit]
Description=Fastd Prometheus Exporter
Documentation=https://github.com/freifunk-darmstadt/fastd-exporter
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
{% if fastd_exporter_opts is defined %}
ExecStart={{ fastd_exporter_path }} {{ fastd_exporter_default_opts }} {{ fastd_exporter_opts }} --instances="{% for mesh in meshes %}{% for instance in mesh.fastd.nodes.instances %}{{ mesh.id }}vpn-{{ instance.mtu }}{% if not loop.last %},{% endif %}{% endfor %}{% if not loop.last %},{% endif %}{% endfor %}"
{% else %}
ExecStart={{ fastd_exporter_path }} {{ fastd_exporter_default_opts }} --instances="{% for mesh in meshes %}{% for instance in mesh.fastd.nodes.instances %}{{ mesh.id }}vpn-{{ instance.mtu }}{% if not loop.last %},{% endif %}{% endfor %}{% if not loop.last %},{% endif %}{% endfor %}"
{% endif %}
Restart=always
RestartSec=5s
[Install]
WantedBy=multi-user.target