2024-09-24 07:38:05 +00:00
|
|
|
- name: Install NRPE packages
|
2024-09-23 12:30:38 +00:00
|
|
|
apt:
|
2024-10-10 11:21:32 +00:00
|
|
|
name: "{{ nagios_packages }}"
|
2024-09-23 12:30:38 +00:00
|
|
|
state: present
|
2024-10-08 14:12:56 +00:00
|
|
|
install_recommends: no
|
2024-09-24 07:38:05 +00:00
|
|
|
- name: Set NRPE generic configuration
|
2024-09-27 11:26:47 +00:00
|
|
|
template:
|
2024-09-24 07:38:05 +00:00
|
|
|
src: nrpe.cfg
|
2024-09-23 12:30:38 +00:00
|
|
|
dest: /etc/nagios/nrpe.d/90-vn.cfg
|
|
|
|
owner: root
|
|
|
|
group: root
|
2024-09-27 11:26:47 +00:00
|
|
|
mode: u=rw,g=r,o=r
|
2024-09-24 07:38:05 +00:00
|
|
|
- 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
|
2024-09-27 11:26:47 +00:00
|
|
|
mode: u=rw,g=r,o=
|
|
|
|
modification_time: preserve
|
|
|
|
access_time: preserve
|
2024-10-08 14:35:53 +00:00
|
|
|
- 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
|