forked from evolix/ansible-roles
Add drbd role
This commit is contained in:
parent
65596db347
commit
a3a56cdc3e
2
drbd/files/munin-plugins
Normal file
2
drbd/files/munin-plugins
Normal file
|
@ -0,0 +1,2 @@
|
|||
[drbd]
|
||||
user root
|
5
drbd/handlers/main.yml
Normal file
5
drbd/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: restart munin-node
|
||||
service:
|
||||
name: munin-node
|
||||
state: restarted
|
9
drbd/tasks/main.yml
Normal file
9
drbd/tasks/main.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
- include: packages.yml
|
||||
|
||||
- name: Mount /usr in rw
|
||||
command: mount -o remount,rw /usr warn=no
|
||||
changed_when: False
|
||||
|
||||
- include: munin.yml
|
||||
- include: nagios.yml
|
25
drbd/tasks/munin.yml
Normal file
25
drbd/tasks/munin.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
- file:
|
||||
path: '/usr/local/share/munin/plugins/'
|
||||
state: directory
|
||||
mode: 02755
|
||||
|
||||
- name: Get Munin plugin
|
||||
get_url:
|
||||
url: 'https://raw.githubusercontent.com/munin-monitoring/contrib/master/plugins/drbd/drbd'
|
||||
dest: '/usr/local/share/munin/plugins/'
|
||||
mode: 0755
|
||||
notify: restart munin-node
|
||||
|
||||
- name: Activate Munin plugin
|
||||
file:
|
||||
src: "/usr/local/share/munin/plugins/drbd"
|
||||
dest: "/etc/munin/plugins/drbd"
|
||||
state: link
|
||||
notify: restart munin-node
|
||||
|
||||
- name: Copy Munin plugin conf
|
||||
copy:
|
||||
src: files/munin-plugins
|
||||
dest: '/etc/munin/plugin-conf.d/drbd'
|
||||
notify: restart munin-node
|
6
drbd/tasks/nagios.yml
Normal file
6
drbd/tasks/nagios.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
- name: Get Nagios plugin
|
||||
get_url:
|
||||
url: 'https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=3367&cf_id=30'
|
||||
dest: '/usr/local/lib/nagios/plugins/check_drbd'
|
||||
mode: 0755
|
3
drbd/tasks/packages.yml
Normal file
3
drbd/tasks/packages.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
- name: Install dependency
|
||||
apt:
|
||||
name: drbd-utils
|
Loading…
Reference in a new issue