From d199a97ba7925b791f0dd4c6e2c06bdd70102977 Mon Sep 17 00:00:00 2001 From: Kali Hernandez Date: Sun, 25 Feb 2024 00:18:36 +0100 Subject: [PATCH] 937: template wazuh_api_yaml.erb config changes from v4.3.x to v4.4.x formats Use `@server_package_version` on the template to check the version of the package and set the `upload_configuration:` section or `remote_commands:` accordingly to the package version. This ensures the module is still able to manage a wazuh agent of a pre-4.4.x version. --- templates/wazuh_api_yml.erb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/templates/wazuh_api_yml.erb b/templates/wazuh_api_yml.erb index 6b2e67b0..4dd36a62 100644 --- a/templates/wazuh_api_yml.erb +++ b/templates/wazuh_api_yml.erb @@ -38,6 +38,7 @@ drop_privileges: <%= @wazuh_api_drop_privileges %> # Enable features under development experimental_features: <%= @wazuh_api_experimental_features %> # Enable remote commands +<%- if scope.function_versioncmp([@server_package_version, '4.4']) >= 0 -%> upload_configuration: remote_commands: localfile: @@ -49,3 +50,12 @@ upload_configuration: limits: eps: allow: <%= @limits_eps %> +<%- else -%> +remote_commands: + localfile: + enabled: <%= @remote_commands_localfile %> + exceptions: <%= @remote_commands_localfile_exceptions %> + wodle_command: + enabled: <%= @remote_commands_wodle %> + exceptions: [] +<%- end -%>