Added grafana restart handler.
authorLuke Hoersten <luke@hoersten.org>
Mon, 10 Feb 2020 09:02:51 -0600
changeset 8 20975062661d
parent 7 dc3fca0131a7
child 9 e58af497ee2f
Added grafana restart handler.
prometheus/rpi-client/tasks/main.yaml
prometheus/server/handlers/main.yaml
prometheus/server/tasks/main.yaml
--- a/prometheus/rpi-client/tasks/main.yaml	Mon Feb 10 07:49:58 2020 -0600
+++ b/prometheus/rpi-client/tasks/main.yaml	Mon Feb 10 09:02:51 2020 -0600
@@ -4,7 +4,7 @@
   become: yes
   user: name="prometheus" groups="video" append="yes"
 
-- name: install prometheus rpi exporter
+- name: install prometheus rpi-exporter
   unarchive:
     src: "https://github.com/lukasmalkmus/rpi_exporter/releases/download/v{{prometheus_client_rpi_exporter_version}}/rpi_exporter-{{prometheus_client_rpi_exporter_version}}.linux-{{prometheus_client_arch}}.tar.gz"
     remote_src: yes
--- a/prometheus/server/handlers/main.yaml	Mon Feb 10 07:49:58 2020 -0600
+++ b/prometheus/server/handlers/main.yaml	Mon Feb 10 09:02:51 2020 -0600
@@ -3,3 +3,7 @@
 - name: restart prometheus service
   systemd: name="prometheus.service" state="restarted" daemon_reload="yes"
   become: yes
+
+- name: restart grafana service
+  systemd: name="grafana-server.service" state="restarted" daemon_reload="yes"
+  become: yes
--- a/prometheus/server/tasks/main.yaml	Mon Feb 10 07:49:58 2020 -0600
+++ b/prometheus/server/tasks/main.yaml	Mon Feb 10 09:02:51 2020 -0600
@@ -17,6 +17,8 @@
   template:
     src: "{{prometheus_server_conf}}"
     dest: "/etc/prometheus/prometheus.yml"
-  notify: restart prometheus service
+  notify:
+    - restart prometheus service
+    - restart grafana service
 
 # /etc/grafana/grafana.ini