2016-12-14 17:57:19 +00:00
|
|
|
---
|
|
|
|
- name: Install NRPE daemon
|
|
|
|
package:
|
2019-11-13 20:49:59 +00:00
|
|
|
name: "{{ monitored_packages_nrpe }}"
|
2016-12-14 17:57:19 +00:00
|
|
|
state: latest
|
|
|
|
|
|
|
|
- name: Install daemon config
|
|
|
|
template:
|
|
|
|
src: nrpe.cfg.j2
|
|
|
|
dest: "{{ monitored_nrpe_basedir }}/nrpe.cfg"
|
2019-11-13 20:49:59 +00:00
|
|
|
owner: "root"
|
2016-12-14 17:57:19 +00:00
|
|
|
group: "{{ monitored_group }}"
|
|
|
|
mode: 0640
|
2019-11-13 20:49:59 +00:00
|
|
|
backup: yes
|
2016-12-14 17:57:19 +00:00
|
|
|
|
|
|
|
- name: Create snippet config dirs
|
|
|
|
file:
|
|
|
|
path: "{{ monitored_nrpe_basedir }}/{{ item }}"
|
|
|
|
state: directory
|
2019-11-13 20:49:59 +00:00
|
|
|
owner: "{{ monitored_nrpe_include_owner }}"
|
2016-12-14 17:57:19 +00:00
|
|
|
group: "{{ monitored_group }}"
|
|
|
|
mode: 0750
|
2019-11-13 20:49:59 +00:00
|
|
|
loop: "{{ monitored_nrpe_include_dirs }}"
|
2016-12-14 17:57:19 +00:00
|
|
|
|
2019-11-13 20:49:59 +00:00
|
|
|
- name: "INCLUDE: Migrate custom NRPE files"
|
2022-11-30 13:23:13 +00:00
|
|
|
import_tasks: nrpe_migrate.yml
|
2016-12-14 17:57:19 +00:00
|
|
|
|
|
|
|
- name: Enable NRPE
|
|
|
|
service:
|
|
|
|
name: "{{ monitored_nrpe_servicename }}"
|
|
|
|
enabled: yes
|
|
|
|
|
2018-03-13 17:47:20 +00:00
|
|
|
- name: Restart NRPE
|
2016-12-14 17:57:19 +00:00
|
|
|
service:
|
|
|
|
name: "{{ monitored_nrpe_servicename }}"
|
2018-03-13 17:47:20 +00:00
|
|
|
state: restarted
|
2016-12-14 17:57:19 +00:00
|
|
|
|
2021-02-18 11:58:15 +00:00
|
|
|
- name: Install additional packages for NRPE monitoring
|
2018-04-22 12:14:03 +00:00
|
|
|
package:
|
2019-11-13 20:49:59 +00:00
|
|
|
name: "{{ monitored_packages_additional_nrpe }}"
|
2018-04-22 12:14:03 +00:00
|
|
|
state: latest
|
2019-11-18 19:41:01 +00:00
|
|
|
when: monitored_packages_additional_nrpe != []
|
2018-04-22 12:14:03 +00:00
|
|
|
|