diff --git a/roles/debian-base/tasks/nrpe.yml b/roles/debian-base/tasks/nrpe.yml index d5e98a1..b0aaf5e 100644 --- a/roles/debian-base/tasks/nrpe.yml +++ b/roles/debian-base/tasks/nrpe.yml @@ -10,6 +10,7 @@ owner: root group: root mode: u=rw,g=r,o=r + notify: restart-nrpe - name: Create NRPE local configuration file file: path: /etc/nagios/nrpe.d/99-local.cfg @@ -19,9 +20,3 @@ 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 \ No newline at end of file diff --git a/roles/debian-base/templates/nrpe.cfg b/roles/debian-base/templates/nrpe.cfg index 7efab1f..99329fd 100644 --- a/roles/debian-base/templates/nrpe.cfg +++ b/roles/debian-base/templates/nrpe.cfg @@ -1,4 +1,5 @@ allowed_hosts={{ nagios_server }} +server_address={{ ansible_default_ipv4.address }} command[check_disk_root]=/usr/lib/nagios/plugins/check_disk -w 10% -c 5% -p / command[check_disk_var]=/usr/lib/nagios/plugins/check_disk -w 10% -c 5% -p /var