diff --git a/ansible-wazuh-agent/templates/var-ossec-etc-ossec-agent.conf.j2 b/ansible-wazuh-agent/templates/var-ossec-etc-ossec-agent.conf.j2
index a5047bdb..8dc802c1 100644
--- a/ansible-wazuh-agent/templates/var-ossec-etc-ossec-agent.conf.j2
+++ b/ansible-wazuh-agent/templates/var-ossec-etc-ossec-agent.conf.j2
@@ -39,6 +39,7 @@
no
+ {% if wazuh_agent_config.rootcheck is defined %}
no
yes
@@ -71,7 +72,9 @@
yes
+ {% endif %}
+ {% if wazuh_agent_config.syscheck is defined %}
no
{% if ansible_os_family == "Windows" %}
@@ -117,6 +120,7 @@
{% endfor %}
{% endif %}
+ {% endif %}
{% if ansible_system == "Linux" and wazuh_agent_config.openscap.disable == 'no' %}