drbd-utils: check if Nagios/Munin are installed

This commit is contained in:
Jérémy Lecour 2017-01-10 11:08:14 +01:00 committed by Jérémy Lecour
parent d42c450573
commit 9d5a099fc4
2 changed files with 14 additions and 0 deletions

View file

@ -1,15 +1,22 @@
---
- name: Check if Munin plugins exists
stat:
path: /etc/munin/plugins/
register: munin_plugins_dir
# https://raw.githubusercontent.com/munin-monitoring/contrib/master/plugins/drbd/drbd
- name: Get Munin plugin
copy:
src: munin/drbd-plugin
dest: /etc/munin/plugins/drbd
mode: "755"
when: munin_plugins_dir.stat.exist
notify: restart munin-node
- name: Copy Munin plugin conf
copy:
src: munin/drbd-config
dest: /etc/munin/plugin-conf.d/drbd
when: munin_plugins_dir.stat.exist
notify: restart munin-node

View file

@ -1,8 +1,14 @@
---
- name: Check if Nagios is installed
stat:
path: /usr/local/lib/nagios/plugins/
register: nagios_plugins_dir
- name: Mount /usr in rw
command: mount -o remount,rw /usr warn=no
changed_when: False
when: nagios_plugins_dir.stat.exist
# https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=3367&cf_id=30
- name: Install Nagios plugin
@ -10,3 +16,4 @@
src: "nagios/check_drbd"
dest: "/usr/local/lib/nagios/plugins/check_drbd"
mode: "755"
when: nagios_plugins_dir.stat.exist