diff --git a/ansible-wazuh-manager/defaults/main.yml b/ansible-wazuh-manager/defaults/main.yml
index 93bec74d..67c83c0a 100644
--- a/ansible-wazuh-manager/defaults/main.yml
+++ b/ansible-wazuh-manager/defaults/main.yml
@@ -167,6 +167,8 @@ wazuh_manager_config:
executable: 'route-null.cmd'
expect: 'srcip'
timeout_allowed: 'yes'
+ rule_exclude:
+ - '0215-policy_rules.xml'
active_responses:
- command: 'restart-ossec'
location: 'local'
diff --git a/ansible-wazuh-manager/templates/var-ossec-etc-ossec-server.conf.j2 b/ansible-wazuh-manager/templates/var-ossec-etc-ossec-server.conf.j2
index 6ce31f99..0b71d8f5 100644
--- a/ansible-wazuh-manager/templates/var-ossec-etc-ossec-server.conf.j2
+++ b/ansible-wazuh-manager/templates/var-ossec-etc-ossec-server.conf.j2
@@ -118,8 +118,21 @@
{% for connection in wazuh_manager_config.connection %}
{{ connection.type }}
- {{ connection.port }}
- {{ connection.protocol }}
+ {% if connection.port is defined %}{{ connection.port }}{% endif %}
+ {% if connection.protocol is defined %}{{ connection.protocol }}{% endif %}
+ {% if connection.allowed_ips is defined %}
+ {% for allowed_ip in connection.allowed_ips %}
+ {{ allowed_ip }}
+ {% endfor %}
+ {% endif %}
+ {% if connection.denied_ips is defined %}
+ {% for denied_ip in connection.denied_ips %}
+ {{ denied_ip }}
+ {% endfor %}
+ {% endif %}
+ {% if connection.local_ip is defined %}{{ connection.local_ip }}{% endif %}
+ {% if connection.ipv6 is defined %}{{ connection.ipv6 }}{% endif %}
+ {% if connection.queue_size is defined %}{{ connection.queue_size }}{% endif %}
{% endfor %}
@@ -294,7 +307,11 @@
ruleset/decoders
ruleset/rules
- 0215-policy_rules.xml
+ {% if wazuh_manager_config.rule_exclude is defined %}
+ {% for rule in wazuh_manager_config.rule_exclude %}
+ {{ rule }}
+ {% endfor %}
+ {% endif %}
{% if cdb_lists is defined %}
{% for list in cdb_lists %}
etc/lists/{{ list.name }}
@@ -309,8 +326,8 @@
{% for response in wazuh_manager_config.active_responses %}
- no
- {{ response.command }}
+ {% if response.disabled is defined %}{{ response.disabled }}{% else %}no{% endif %}
+ {%if response.command is defined %}{{ response.command }}{% endif %}
{%if response.location is defined %}{{ response.location }}{% endif %}
{%if response.agent_id is defined %}{{ response.agent_id }}{% endif %}
{%if response.level is defined %}{{ response.level }}{% endif %}
@@ -327,9 +344,33 @@
{{ 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 key, value in localfile.labels.iteritems() %}
+
+ {% endfor %}
+ {% endif %}
+ {% if localfile.target is defined %}
+ {{ localfile.target }}
+ {% endif %}
+ {% if localfile.out_format is defined %}
+ {{ localfile.out_format }}
{% endif %}
{% endfor %}
diff --git a/ansible-wazuh-manager/templates/var-ossec-etc-shared-agent.conf.j2 b/ansible-wazuh-manager/templates/var-ossec-etc-shared-agent.conf.j2
index 48c617d2..6b40451d 100644
--- a/ansible-wazuh-manager/templates/var-ossec-etc-shared-agent.conf.j2
+++ b/ansible-wazuh-manager/templates/var-ossec-etc-shared-agent.conf.j2
@@ -46,9 +46,33 @@
{{ 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 key, value in localfile.labels.iteritems() %}
+
+ {% endfor %}
+ {% endif %}
+ {% if localfile.target is defined %}
+ {{ localfile.target }}
+ {% endif %}
+ {% if localfile.out_format is defined %}
+ {{ localfile.out_format }}
{% endif %}
{% endfor %}