From 169a88fee03d6a094e65cc610bfafcc3b2b92130 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 20 Nov 2025 20:15:24 +0100 Subject: [PATCH] install package nrpe --- roles/pips/tasks/nagios_tasks.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/pips/tasks/nagios_tasks.yml b/roles/pips/tasks/nagios_tasks.yml index 06fad7a..17d49a6 100644 --- a/roles/pips/tasks/nagios_tasks.yml +++ b/roles/pips/tasks/nagios_tasks.yml @@ -5,17 +5,20 @@ - name: Check if nagios NRPE is installed debug: msg: "NRPE is installed." - when: "'nagios-nrpe' in ansible_facts.packages" + when: "'nrpe' in ansible_facts.packages" - name: Ensure NRPE is installed (Debian/Ubuntu) apt: name: nrpe state: present become: yes + register: nrpe_install_result + when: "'nrpe' not in ansible_facts.packages" - name: Deploy custom Nagios/NRPE script ansible.builtin.copy: src: memory_usage_check.py dest: /usr/local/nagios/libexec/my_custom_check.py - mode: '0755' \ No newline at end of file + mode: '0755' + when: nrpe_install_result is defined and nrpe_install_result.changed \ No newline at end of file