44 lines
1,021 B
YAML
44 lines
1,021 B
YAML
---
|
|
- name: Install NRPE daemon
|
|
package:
|
|
name: "{{ monitored_packages_nrpe }}"
|
|
state: latest
|
|
|
|
- name: Install daemon config
|
|
template:
|
|
src: nrpe.cfg.j2
|
|
dest: "{{ monitored_nrpe_basedir }}/nrpe.cfg"
|
|
owner: "root"
|
|
group: "{{ monitored_group }}"
|
|
mode: 0640
|
|
backup: yes
|
|
|
|
- name: Create snippet config dirs
|
|
file:
|
|
path: "{{ monitored_nrpe_basedir }}/{{ item }}"
|
|
state: directory
|
|
owner: "{{ monitored_nrpe_include_owner }}"
|
|
group: "{{ monitored_group }}"
|
|
mode: 0750
|
|
loop: "{{ monitored_nrpe_include_dirs }}"
|
|
|
|
- name: "INCLUDE: Migrate custom NRPE files"
|
|
import_tasks: nrpe_migrate.yml
|
|
|
|
- name: Enable NRPE
|
|
service:
|
|
name: "{{ monitored_nrpe_servicename }}"
|
|
enabled: yes
|
|
|
|
- name: Restart NRPE
|
|
service:
|
|
name: "{{ monitored_nrpe_servicename }}"
|
|
state: restarted
|
|
|
|
- name: Install additional packages for NRPE monitoring
|
|
package:
|
|
name: "{{ monitored_packages_additional_nrpe }}"
|
|
state: latest
|
|
when: monitored_packages_additional_nrpe != []
|
|
|