Actualizar linux-config-nagios-nrpe.yaml

This commit is contained in:
David Lopez 2024-09-06 20:14:28 +00:00
parent ce78324462
commit 05e294deec
1 changed files with 9 additions and 18 deletions

View File

@ -6,21 +6,12 @@
gather_facts: no gather_facts: no
tasks: tasks:
- name: "[DEBUG] Comprobando si es necesario configurar nagios nrpe service" # Paso 1: Instalar paquetes necesarios para Nagios NRPE
debug: - name: "[CONFIG NAGIOS NRPE] Instalar paquetes nagios-nrpe-server y nagios-nrpe-plugin"
var: nagios_nrpe_enabled apt:
name: "{{ item }}"
- name: "[CONFIG NAGIOS NRPE] Definir valor predeterminado para nagios_nrpe_enabled si no está definido" state: present
set_fact: update_cache: yes
nagios_nrpe_enabled: false loop:
when: nagios_nrpe_enabled is not defined - nagios-nrpe-server
- nagios-nrpe-plugin
- 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 | bool == false
- name: "[CONFIG NAGIOS NRPE] Install and configure nagios nrpe service"
import_role:
name: config-nagios-nrpe
when: nagios_nrpe_enabled | bool