From d1b80ebd29fc6713714911523c22ca553808dfa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Acu=C3=B1a?= Date: Wed, 27 Apr 2022 19:07:07 -0300 Subject: [PATCH] If added to agent.conf template localfile tag --- .../ansible-filebeat-oss/defaults/main.yml | 2 +- .../var-ossec-etc-shared-agent.conf.j2 | 72 ++++++++++--------- 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/roles/wazuh/ansible-filebeat-oss/defaults/main.yml b/roles/wazuh/ansible-filebeat-oss/defaults/main.yml index 5e47eb65..241e5026 100644 --- a/roles/wazuh/ansible-filebeat-oss/defaults/main.yml +++ b/roles/wazuh/ansible-filebeat-oss/defaults/main.yml @@ -1,7 +1,7 @@ --- filebeat_version: 7.10.2 -wazuh_template_branch: v4.3.0 +wazuh_template_branch: 4.3 filebeat_node_name: node-1 diff --git a/roles/wazuh/ansible-wazuh-manager/templates/var-ossec-etc-shared-agent.conf.j2 b/roles/wazuh/ansible-wazuh-manager/templates/var-ossec-etc-shared-agent.conf.j2 index 6ac6b41d..7af5e3f3 100644 --- a/roles/wazuh/ansible-wazuh-manager/templates/var-ossec-etc-shared-agent.conf.j2 +++ b/roles/wazuh/ansible-wazuh-manager/templates/var-ossec-etc-shared-agent.conf.j2 @@ -43,41 +43,43 @@ {% endif %} - {% for localfile in agent_config.localfiles %} - - {{ localfile.format }} - {% if localfile.format == 'command' or localfile.format == 'full_command' %} - {{ localfile.command }} - {% if localfile.alias is defined %} - {{ localfile.alias }} - {% endif %} - {% if localfile.frequency is defined %} - {{ localfile.frequency }} - {% endif %} - {% else %} - {{ localfile.location }} - {% if localfile.format == 'eventchannel' %} - {% if localfile.only_future_events is defined %} - {{ localfile.only_future_events }} - {% endif %} - {% if localfile.query is defined %} - {{ localfile.query }} - {% endif %} - {% endif %} - {% endif %} - {% if localfile.format == 'json' and localfile.labels is defined %} - {% for item in localfile.labels %} - - {% endfor %} - {% endif %} - {% if localfile.target is defined %} - {{ localfile.target }} - {% endif %} - {% if localfile.out_format is defined %} - {{ localfile.out_format }} - {% endif %} - - {% endfor %} + {% if agent_config.localfiles is defined %} + {% for localfile in agent_config.localfiles %} + + {{ localfile.format }} + {% if localfile.format == 'command' or localfile.format == 'full_command' %} + {{ localfile.command }} + {% if localfile.alias is defined %} + {{ localfile.alias }} + {% endif %} + {% if localfile.frequency is defined %} + {{ localfile.frequency }} + {% endif %} + {% else %} + {{ localfile.location }} + {% if localfile.format == 'eventchannel' %} + {% if localfile.only_future_events is defined %} + {{ localfile.only_future_events }} + {% endif %} + {% if localfile.query is defined %} + {{ localfile.query }} + {% endif %} + {% endif %} + {% endif %} + {% if localfile.format == 'json' and localfile.labels is defined %} + {% for item in localfile.labels %} + + {% endfor %} + {% endif %} + {% if localfile.target is defined %} + {{ localfile.target }} + {% endif %} + {% if localfile.out_format is defined %} + {{ localfile.out_format }} + {% endif %} + + {% endfor %} + {% endif %} {% if agent_config.rootcheck is defined %}