Skip to content

Commit 9cd1749

Browse files
author
Mooash
committed
Moving nrpe_ansible.cfg over to a j2 template so it can be used cross server
1 parent 2edc54d commit 9cd1749

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

files/nrpe_ansible.cfg

Whitespace-only changes.

tasks/main.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@
2828
template: >
2929
src=nrpe.cfg.j2
3030
dest=/etc/nagios/nrpe.cfg
31-
owner=root group=root mode=0644 backup=yes
31+
owner=root group=root mode=0644
3232
notify: restart nagios-nrpe-server
3333

34-
# Copy nrpe_local.cfg
35-
- name: Ensure nrpe_ansible.cfg is up to date
36-
copy: dest=/etc/nagios/nrpe_ansible.cfg src=nrpe_ansible.cfg
37-
owner=root group=root mode=0644
34+
# Create nrpe_ansible.cfg
35+
- name: Create nrpe_ansible.cfg from template
36+
template: >
37+
src=nrpe_ansible.cfg.j2
38+
dest=/etc/nagios/nrpe_ansible.cfg
39+
owner=root group=root mode=0644
3840
notify: restart nagios-nrpe-server
3941

4042
# Ensure NRPE server is running and will start at boot

templates/nrpe_ansible.cfg.j2

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#################################
2+
# THIS FILE IS MANAGED BY ANSIBLE
3+
# DO NOT EDIT LOCALLY
4+
#################################
5+
6+
# Example check
7+
command[check_mailq]={{ nagios_nrpe_server_plugins_dir }}/check_mailq -c 50 -w 20
8+

0 commit comments

Comments
 (0)