fail2ban: Install munin plugin if available

This commit is contained in:
Jérémy Lecour 2017-12-01 09:00:08 +01:00 committed by Jérémy Lecour
parent cf8b110abb
commit 25a5ffd6ef
2 changed files with 36 additions and 0 deletions

View file

@ -3,3 +3,8 @@
service:
name: fail2ban
state: restarted
- name: restart munin-node
service:
name: munin-node
state: restarted

View file

@ -47,3 +47,34 @@
tags:
- fail2ban
- packages
- name: is Munin present ?
stat:
path: /etc/munin/plugins
check_mode: no
register: etc_munin_plugins
tags:
- fail2ban
- munin
- name: is fail2ban Munin plugin available ?
stat:
path: /usr/share/munin/plugins/fail2ban
check_mode: no
register: fail2ban_munin_plugin
tags:
- fail2ban
- munin
- name: Enable Munin plugins
file:
src: "/usr/share/munin/plugins/fail2ban"
dest: "/etc/munin/plugins/fail2ban"
state: link
notify: restart munin-node
when:
- etc_munin_plugins.stat.exists?
- fail2ban_munin_plugin.stat.exists?
tags:
- fail2ban
- munin