From c8334a41bd4f81e551d2c28a74c2fe2c7e03e420 Mon Sep 17 00:00:00 2001 From: rubenb Date: Thu, 15 Feb 2024 17:46:14 +0100 Subject: [PATCH] add conditional --- linux-config-zabbix-agent.yaml | 5 +++++ roles/config-zabbix-agent/tasks/main.yaml | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/linux-config-zabbix-agent.yaml b/linux-config-zabbix-agent.yaml index 1989595..8d9b6fc 100644 --- a/linux-config-zabbix-agent.yaml +++ b/linux-config-zabbix-agent.yaml @@ -7,6 +7,11 @@ tasks: + - name: "[CONFIG ZABBIX AGENT] Comprobando si es necesario configurar ZABBIX AGENT" + debug: + msg: "No es necesario configurar ZABBIX AGENT en la máquina" + when: zabbix-agent_enabled is not defined or not zabbix-agent_enabled + - name: "[CONFIG ZABBIX AGENT] Install and configure ZABBIX AGENT" import_role: name: config-zabbix-agent \ No newline at end of file diff --git a/roles/config-zabbix-agent/tasks/main.yaml b/roles/config-zabbix-agent/tasks/main.yaml index 73630b8..dd6eb87 100644 --- a/roles/config-zabbix-agent/tasks/main.yaml +++ b/roles/config-zabbix-agent/tasks/main.yaml @@ -2,6 +2,10 @@ # Install and configure ZABBIX AGENT #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +- name: "[CONFIG ZABBIX AGENT] Comprobando si es necesario configurar ZABBIX AGENT" + meta: end_host + when: zabbix-agent_enabled is not defined or not zabbix-agent_enabled + #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Paso1 # Download zabbix repository