vn-ansible/roles/debian-base/tasks/nrpe.yml

31 lines
800 B
YAML
Raw Normal View History

- name: Install NRPE packages
2024-09-23 12:30:38 +00:00
apt:
name: "{{ item }}"
state: present
install_recommends: no
2024-09-23 12:30:38 +00:00
loop:
- nagios-nrpe-server
- nagios-plugins-contrib
- monitoring-plugins-basic
- name: Set NRPE generic configuration
template:
src: nrpe.cfg
2024-09-23 12:30:38 +00:00
dest: /etc/nagios/nrpe.d/90-vn.cfg
owner: root
group: root
mode: u=rw,g=r,o=r
- name: Create NRPE local configuration file
2024-09-23 12:30:38 +00:00
file:
path: /etc/nagios/nrpe.d/99-local.cfg
state: touch
owner: nagios
group: nagios
mode: u=rw,g=r,o=
modification_time: preserve
access_time: preserve
- name: Configure nrpe.cfg to bind ipv4
lineinfile:
path: /etc/nagios/nrpe.cfg
regexp: '^#server_address=127.0.0.1'
line: 'server_address={{ ansible_default_ipv4.address }}'
notify: restart-nrpe