Merge "Add grafana admin password management"
diff --git a/grafana/client/init.sls b/grafana/client/init.sls
index 129d52a..645dda0 100644
--- a/grafana/client/init.sls
+++ b/grafana/client/init.sls
@@ -111,4 +111,7 @@
 {%- endif %}
 {%- endfor %}
 
+include:
+- grafana.client.user
+
 {%- endif %}
diff --git a/grafana/client/user.sls b/grafana/client/user.sls
new file mode 100644
index 0000000..e45de31
--- /dev/null
+++ b/grafana/client/user.sls
@@ -0,0 +1,18 @@
+{%- from "grafana/map.jinja" import client with context %}
+
+grafana_admin_user_{{ client.server.user }}_present:
+  grafana4_user.present:
+    - name: {{ client.server.user }}
+    - password: {{ client.server.password }}
+    - email: "{{ client.server.user }}@localhost"
+    - fullname: {{ client.server.user }}
+    - is_admin: true
+
+grafana_admin_user_{{ client.server.user }}_update_password:
+  module.run:
+  - name: grafana4.update_user_password
+  - userid: {{ client.server.user_id }}
+  - kwargs:
+      password: {{ client.server.password }}
+  - require:
+    - grafana4_user: grafana_admin_user_{{ client.server.user }}_present
diff --git a/grafana/map.jinja b/grafana/map.jinja
index c7c4bd4..d81508a 100644
--- a/grafana/map.jinja
+++ b/grafana/map.jinja
@@ -54,6 +54,9 @@
   server:
     host: 127.0.0.1
     port: 3000
+    user: admin
+    password: admin
+    user_id: 1
   remote_data:
     engine: none
   datasource: {}