summaryrefslogtreecommitdiff
path: root/roles/install_monitoring
diff options
context:
space:
mode:
Diffstat (limited to 'roles/install_monitoring')
-rw-r--r--roles/install_monitoring/handlers/munin.yml5
-rw-r--r--roles/install_monitoring/tasks/install_munin.yml4
-rw-r--r--roles/install_monitoring/tasks/install_vnstat.yml10
3 files changed, 11 insertions, 8 deletions
diff --git a/roles/install_monitoring/handlers/munin.yml b/roles/install_monitoring/handlers/munin.yml
new file mode 100644
index 0000000..d0f2d58
--- /dev/null
+++ b/roles/install_monitoring/handlers/munin.yml
@@ -0,0 +1,5 @@
+---
+- name: restart munin-node
+ systemd:
+ name: munin-node.service
+ state: restarted
diff --git a/roles/install_monitoring/tasks/install_munin.yml b/roles/install_monitoring/tasks/install_munin.yml
index 1b442dc..bda0e6f 100644
--- a/roles/install_monitoring/tasks/install_munin.yml
+++ b/roles/install_monitoring/tasks/install_munin.yml
@@ -8,6 +8,7 @@
template:
src: munin-node.conf.j2
dest: /etc/munin/munin-node.conf
+ notify: restart munin-node
- name: copy fastd plugin
copy:
@@ -25,11 +26,13 @@
copy:
src: munin/munin_fastd_conf
dest: /etc/munin/plugin-conf.d/fastd
+ notify: restart munin-node
- name: copy global config
copy:
src: munin/munin_global_conf
dest: /etc/munin/plugin-conf.d/global
+ notify: restart munin-node
- name: install netstat
pacman:
@@ -52,6 +55,7 @@
src: /usr/lib/munin/plugins/{{ item.plugin | default( item.name ) }}
state: link
with_items: "{{ munin_node_plugins }}"
+ notify: restart munin-node
- name: start and enable munin-node
systemd:
diff --git a/roles/install_monitoring/tasks/install_vnstat.yml b/roles/install_monitoring/tasks/install_vnstat.yml
index 0198403..9113331 100644
--- a/roles/install_monitoring/tasks/install_vnstat.yml
+++ b/roles/install_monitoring/tasks/install_vnstat.yml
@@ -48,17 +48,11 @@
copy:
src: vnstat
dest: /etc/nginx/sites-available/vnstat
- register: nginx_config
+ notify: reload nginx
- name: enable vnstat nginx config
file:
src: /etc/nginx/sites-available/vnstat
dest: /etc/nginx/sites-enabled/vnstat
state: link
-
-- name: reload nginx
- when: nginx_config.changed
- systemd:
- name: nginx.service
- state: reloaded
-
+ notify: reload nginx