mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-20 12:07:34 +08:00
Use custom grafana.service file with Restart=always defined
Signed-off-by: Ricky Elrod <codeblock@fedoraproject.org>
This commit is contained in:
23
roles/graphite/grafana/files/grafana.service
Normal file
23
roles/graphite/grafana/files/grafana.service
Normal file
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=Starts and stops a single grafana instance on this system
|
||||
Documentation=http://docs.grafana.org
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/sysconfig/grafana-server
|
||||
User=grafana
|
||||
Group=grafana
|
||||
Type=simple
|
||||
WorkingDirectory=/usr/share/grafana
|
||||
ExecStart=/usr/sbin/grafana-server \
|
||||
--config=${CONF_FILE} \
|
||||
cfg:default.paths.logs=${LOG_DIR} \
|
||||
cfg:default.paths.data=${DATA_DIR} \
|
||||
LimitNOFILE=10000
|
||||
TimeoutStopSec=20
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
3
roles/graphite/grafana/handlers/main.yml
Normal file
3
roles/graphite/grafana/handlers/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- name: restart grafana
|
||||
service: name=grafana-server state=restarted
|
||||
@@ -35,3 +35,14 @@
|
||||
- restart apache
|
||||
tags:
|
||||
- grafana
|
||||
- config
|
||||
|
||||
- name: Install custom systemd service file
|
||||
copy: >
|
||||
src=grafana.service
|
||||
dest=/usr/lib/systemd/system/grafana.service
|
||||
tags:
|
||||
- config
|
||||
- grafana
|
||||
notify:
|
||||
- restart grafana
|
||||
|
||||
Reference in New Issue
Block a user