initial commit
This commit is contained in:
3
tasks/main.yml
Normal file
3
tasks/main.yml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
- name: "monitoring | install nrpe"
|
||||
include: nrpe.yml
|
42
tasks/nrpe.yml
Normal file
42
tasks/nrpe.yml
Normal file
@ -0,0 +1,42 @@
|
||||
---
|
||||
- name: nrpe | apt update cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
cache_valid_time: 86400 #One day
|
||||
|
||||
- name: nrpe | install nrpe packages
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
update_cache: true
|
||||
state: present
|
||||
with_items:
|
||||
- nagios-nrpe-server
|
||||
- libmonitoring-plugin-perl
|
||||
- monitoring-plugins-standard
|
||||
- libdbd-mysql-perl
|
||||
|
||||
- name: nrpe | copy nrpe configuration
|
||||
template:
|
||||
src: "nrpe.j2"
|
||||
dest: "/etc/nagios/nrpe.d/brainsys.cfg"
|
||||
mode: "0644"
|
||||
force: yes
|
||||
backup: yes
|
||||
|
||||
- name: nrpe | copy nrpe plugins
|
||||
copy:
|
||||
src: nrpe/
|
||||
dest: /usr/lib/nagios/plugins
|
||||
mode: 0755
|
||||
|
||||
- name: nrpe | restart nagios-nrpe-server
|
||||
systemd:
|
||||
state: restarted
|
||||
name: nagios-nrpe-server
|
||||
|
||||
- name: nrpe | allow nagios user to specific sudo
|
||||
template:
|
||||
src: nrpe.sudoers.j2
|
||||
dest: /etc/sudoers.d/nrpe
|
||||
validate: 'visudo -cf %s'
|
||||
mode: 0440
|
Reference in New Issue
Block a user