coreos-home-server/service/grafana/systemd/grafana-dashboard@.service

18 lines
567 B
SYSTEMD
Raw Normal View History

[Unit]
Description=Register Grafana Dashboard for %I
Wants=grafana.service
After=grafana.service
ConditionPathExists=%E/coreos-home-server/%i/service/%p.json
[Service]
Type=oneshot
RemainAfterExit=true
SyslogIdentifier=%N
Environment=DASHBOARD_CONF=%E/coreos-home-server/%i/service/%p.json
ExecStartPre=/bin/podman exec grafana mkdir -p /var/lib/grafana/dashboards
ExecStart=/bin/podman cp ${DASHBOARD_CONF} grafana:/var/lib/grafana/dashboards/%i.json
ExecStop=/bin/podman exec grafana rm -f /var/lib/grafana/dashboards/%i.json
[Install]
WantedBy=multi-user.target