nrpe/tasks/nrpe.yml

43 lines
877 B
YAML
Raw Normal View History

2024-12-16 19:24:54 +01:00
---
- 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