From 69e22ffac2fa6ef03c6f303f96bdd3b068ac87c5 Mon Sep 17 00:00:00 2001
From: abednarik <alejandro.bednarik@gmail.com>
Date: Fri, 4 Aug 2017 12:36:22 -0300
Subject: [PATCH] Make grafana paths configurable.

---
 grafana/files/grafana.ini | 5 ++---
 grafana/map.jinja         | 3 +++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/grafana/files/grafana.ini b/grafana/files/grafana.ini
index f2071bb..da3ee3f 100644
--- a/grafana/files/grafana.ini
+++ b/grafana/files/grafana.ini
@@ -11,11 +11,11 @@
 [paths]
 # Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used)
 #
-;data = /var/lib/grafana
+data = {{ server.paths.data }}
 #
 # Directory where grafana can store logs
 #
-;logs = /var/log/grafana
+logs = {{ server.paths.logs }}
 
 #################################### Server ####################################
 [server]
@@ -288,4 +288,3 @@ path = {{ server.dashboards.path }}
 ;enabled = false
 ;path = /var/lib/grafana/dashboards
 {%- endif %}
-
diff --git a/grafana/map.jinja b/grafana/map.jinja
index dc0a52d..5562a39 100644
--- a/grafana/map.jinja
+++ b/grafana/map.jinja
@@ -4,6 +4,9 @@ Debian:
   pkgs:
   - grafana
   service: grafana-server
+  paths:
+    data: /var/lib/grafana
+    logs: /var/log/grafana
   bind:
     address: 0.0.0.0
     port: 3000