From 022304c9f86d9507747a55f5a424d1816e1e641e Mon Sep 17 00:00:00 2001 From: David Lopez Date: Fri, 6 Sep 2024 20:09:44 +0000 Subject: [PATCH] Actualizar linux-config-nagios-nrpe.yaml --- linux-config-nagios-nrpe.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/linux-config-nagios-nrpe.yaml b/linux-config-nagios-nrpe.yaml index 741f564..6233bee 100644 --- a/linux-config-nagios-nrpe.yaml +++ b/linux-config-nagios-nrpe.yaml @@ -6,12 +6,23 @@ gather_facts: no tasks: - - name: "[CONFIG NAGIOS NRPE] Comprobando si es necesario configurar nagios nrpe service " + - name: "[DEBUG] Comprobando si es necesario configurar nagios nrpe service" + debug: + var: nagios_nrpe_enabled + + - name: "[CONFIG NAGIOS NRPE] Definir valor predeterminado para nagios_nrpe_enabled si no está definido" + set_fact: + nagios_nrpe_enabled: false + when: nagios_nrpe_enabled is not defined + + - name: "[CONFIG NAGIOS NRPE] Comprobando si es necesario configurar nagios nrpe service" debug: msg: "No es necesario configurar nagios nrpe service en la máquina" - when: nagios_nrpe_enabled is not defined or not nagios_nrpe_enabled + when: nagios_nrpe_enabled | bool == false - name: "[CONFIG NAGIOS NRPE] Install and configure nagios nrpe service" import_role: name: config-nagios-nrpe + when: nagios_nrpe_enabled | bool + when: nagios_nrpe_enabled is defined and nagios_nrpe_enabled \ No newline at end of file