Structure overhaul
diff --git a/README.md b/README.rst
similarity index 87%
rename from README.md
rename to README.rst
index e7d5d65..2b25f33 100755
--- a/README.md
+++ b/README.rst
@@ -1,9 +1,12 @@
-# Grafana
+=======
+Grafana
+=======
A beautiful, easy to use and feature rich Graphite dashboard replacement and graph editor.
-## Sample pillar
+Sample pillar
+=============
grafana:
server:
@@ -23,7 +26,7 @@
port: 443
user: test
-## Sample pillar with source from stable package
+Sample pillar with source from stable package
grafana:
server:
@@ -42,7 +45,8 @@
port: 443
user: test
-## Read more
+Read more
+=========
* http://grafana.org/
-* https://github.com/torkelo/grafana/wiki
\ No newline at end of file
+* https://github.com/torkelo/grafana/wiki
diff --git a/conf/config.js b/conf/config.js
deleted file mode 100755
index 956172c..0000000
--- a/conf/config.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/** @scratch /configuration/config.js/1
- * == Configuration
- * config.js is where you will find the core Grafana configuration. This file contains parameter that
- * must be set before kibana is run for the first time.
- */
-define(['settings'],
-function (Settings) {
- "use strict";
-
- return new Settings({
-
- /**
- * elasticsearch url:
- * For Basic authentication use: http://username:password@domain.com:9200
- */
- elasticsearch: "http://{{ pillar.grafana.server.elasticsearch.host }}:{{ pillar.grafana.server.elasticsearch.port }}",
-
- /**
- * graphite-web url:
- * For Basic authentication use: http://username:password@domain.com
- * Basic authentication requires special HTTP headers to be configured
- * in nginx or apache for cross origin domain sharing to work (CORS).
- * Check install documentation on github
- */
- {% if (pillar.grafana.server.data|length) == 1 %}
-
- {% for data in pillar.grafana.server.data %}
- {%- if data.type == "graphite" %}
- graphiteUrl: "http://{{ data.host }}:{{ data.port }}",
- {%- endif %}
- {% endfor %}
-
- {%- else %}
- /*graphiteUrl: "http://"+{{ salt['pillar.get']('grafana:server:data:host', "")}}+":{{ salt['pillar.get']('grafana:server:data:port', 80)}}",
- */
-
- /**
- * Multiple graphite servers? Comment out graphiteUrl and replace with
- *
- * datasources: {
-
- * data_center_us: { type: 'graphite', url: 'http://<graphite_url>', default: true },
- * data_center_eu: { type: 'graphite', url: 'http://<graphite_url>' }
- * }
- */
- {%- endif %}
-
- default_route: '/dashboard/file/default.json',
-
- /**
- * If your graphite server has another timezone than you & users browsers specify the offset here
- * Example: "-0500" (for UTC - 5 hours)
- */
- timezoneOffset: null,
-
- grafana_index: "grafana-dash",
-
- panel_names: [
- 'text',
- 'graphite'
- ]
- });
-});
diff --git a/grafana/init.sls b/grafana/init.sls
new file mode 100755
index 0000000..ce1d045
--- /dev/null
+++ b/grafana/init.sls
@@ -0,0 +1,7 @@
+
+{%- if pillar.grafana is defined %}
+include:
+{%- if pillar.grafana.server is defined %}
+- grafana.server
+{%- endif %}
+{%- endif %}
diff --git a/grafana/meta/sphinx.yml b/grafana/meta/sphinx.yml
new file mode 100644
index 0000000..54b4d3f
--- /dev/null
+++ b/grafana/meta/sphinx.yml
@@ -0,0 +1,7 @@
+doc:
+ name: Grafana
+ description: A beautiful, easy to use and feature rich Graphite dashboard replacement and graph editor.
+ role:
+ server:
+ name: server
+ param: {}
diff --git a/grafana/server.sls b/grafana/server.sls
new file mode 100644
index 0000000..fe30a8d
--- /dev/null
+++ b/grafana/server.sls
@@ -0,0 +1,20 @@
+{%- from "grafana/map.jinja" import server with context %}
+{%- if server.enabled %}
+
+grafana_packages:
+ pkg.installed:
+ - names:
+ - python-memcache
+ - python-psycopg2
+ - python-imaging
+
+/etc/grafana/local_settings.py:
+ file.managed:
+ - source: salt://grafana/files/local_settings.py
+ - template: jinja
+ - user: root
+ - group: root
+ - require:
+ - pkg: grafana_packages
+
+{%- endif %}
\ No newline at end of file
diff --git a/metadata/service/server/single.yml b/metadata/service/server/single.yml
new file mode 100644
index 0000000..db2ade8
--- /dev/null
+++ b/metadata/service/server/single.yml
@@ -0,0 +1,6 @@
+applications:
+- grafana
+parameters:
+ grafana:
+ server:
+ enabled: true
\ No newline at end of file
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
new file mode 100644
index 0000000..0d44256
--- /dev/null
+++ b/metadata/service/support.yml
@@ -0,0 +1,11 @@
+parameters:
+ grafana:
+ _support:
+ collectd:
+ enabled: false
+ heka:
+ enabled: false
+ sensu:
+ enabled: false
+ sphinx:
+ enabled: true