2016-12-16 12:27:38 +01:00
|
|
|
---
|
2017-01-05 18:09:00 +01:00
|
|
|
|
2017-01-10 11:08:14 +01:00
|
|
|
- name: Check if Nagios is installed
|
|
|
|
stat:
|
|
|
|
path: /usr/local/lib/nagios/plugins/
|
|
|
|
register: nagios_plugins_dir
|
2017-03-24 14:15:09 +01:00
|
|
|
check_mode: no
|
2017-05-03 14:19:32 +02:00
|
|
|
tags:
|
|
|
|
- drbd
|
2017-01-10 11:08:14 +01:00
|
|
|
|
2017-01-12 16:23:42 +01:00
|
|
|
- name: Check if /usr is a partition
|
|
|
|
shell: "mount | grep 'on /usr type'"
|
|
|
|
args:
|
|
|
|
warn: no
|
|
|
|
changed_when: False
|
|
|
|
failed_when: False
|
|
|
|
register: usr_partition
|
2017-03-24 14:15:09 +01:00
|
|
|
check_mode: no
|
2017-05-03 14:19:32 +02:00
|
|
|
tags:
|
|
|
|
- drbd
|
2017-01-12 16:23:42 +01:00
|
|
|
|
2017-01-05 18:09:00 +01:00
|
|
|
- name: Mount /usr in rw
|
2017-01-12 16:23:42 +01:00
|
|
|
command: mount -o remount,rw /usr
|
|
|
|
args:
|
|
|
|
warn: no
|
2017-01-05 18:09:00 +01:00
|
|
|
changed_when: False
|
2017-01-12 16:23:42 +01:00
|
|
|
when: usr_partition.rc == 0 and nagios_plugins_dir.stat.exists
|
2017-05-03 14:19:32 +02:00
|
|
|
tags:
|
|
|
|
- drbd
|
2017-01-05 18:09:00 +01:00
|
|
|
|
|
|
|
# https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=3367&cf_id=30
|
|
|
|
- name: Install Nagios plugin
|
|
|
|
copy:
|
|
|
|
src: "nagios/check_drbd"
|
|
|
|
dest: "/usr/local/lib/nagios/plugins/check_drbd"
|
2017-03-23 16:59:43 +01:00
|
|
|
mode: "0755"
|
2017-01-12 14:56:05 +01:00
|
|
|
when: nagios_plugins_dir.stat.exists
|
2017-05-03 14:19:32 +02:00
|
|
|
tags:
|
|
|
|
- drbd
|