From b36e552de5931c305f234a602b9c9b907bb69f65 Mon Sep 17 00:00:00 2001 From: Alex-Welsh Date: Wed, 8 Jan 2025 13:36:18 +0000 Subject: [PATCH 1/2] Purge wazuh_manager_sources_installation --- roles/wazuh/ansible-wazuh-agent/tasks/Debian.yml | 2 -- roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml | 4 ---- roles/wazuh/ansible-wazuh-agent/tasks/RedHat.yml | 1 - roles/wazuh/ansible-wazuh-manager/tasks/Debian.yml | 2 -- roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml | 2 -- 5 files changed, 11 deletions(-) diff --git a/roles/wazuh/ansible-wazuh-agent/tasks/Debian.yml b/roles/wazuh/ansible-wazuh-agent/tasks/Debian.yml index c12e87ed2..9247ccffa 100644 --- a/roles/wazuh/ansible-wazuh-agent/tasks/Debian.yml +++ b/roles/wazuh/ansible-wazuh-agent/tasks/Debian.yml @@ -36,7 +36,6 @@ when: - ansible_facts.distribution == "Ubuntu" - ansible_facts.distribution_major_version | int == 14 - - not wazuh_agent_sources_installation.enabled - not wazuh_custom_packages_installation_agent_enabled - name: Debian/Ubuntu | Download Wazuh repository key @@ -61,7 +60,6 @@ mode: '0644' when: - not (ansible_facts.distribution == "Ubuntu" and ansible_facts.distribution_major_version | int == 14) - - not wazuh_agent_sources_installation.enabled - not wazuh_custom_packages_installation_agent_enabled - name: Debian/Ubuntu | Add Wazuh repositories diff --git a/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml b/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml index 5bf445b46..b267dd4e8 100644 --- a/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml +++ b/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml @@ -16,7 +16,6 @@ lock_timeout: '{{ wazuh_agent_yum_lock_timeout }}' when: - ansible_facts.os_family|lower == "redhat" - - not wazuh_agent_sources_installation.enabled - not wazuh_custom_packages_installation_agent_enabled tags: - init @@ -28,7 +27,6 @@ cache_valid_time: 3600 when: - ansible_facts.os_family|lower != "redhat" - - not wazuh_agent_sources_installation.enabled - not wazuh_custom_packages_installation_agent_enabled - not ansible_check_mode tags: @@ -267,9 +265,7 @@ - include_tasks: "RMRedHat.yml" when: - ansible_facts.os_family == "RedHat" - - not wazuh_agent_sources_installation.enabled - include_tasks: "RMDebian.yml" when: - ansible_facts.os_family == "Debian" - - not wazuh_agent_sources_installation.enabled diff --git a/roles/wazuh/ansible-wazuh-agent/tasks/RedHat.yml b/roles/wazuh/ansible-wazuh-agent/tasks/RedHat.yml index 108e3524d..0fcb0ac43 100644 --- a/roles/wazuh/ansible-wazuh-agent/tasks/RedHat.yml +++ b/roles/wazuh/ansible-wazuh-agent/tasks/RedHat.yml @@ -10,7 +10,6 @@ when: - (ansible_facts['os_family']|lower == 'redhat') and (ansible_facts.distribution|lower != 'amazon') - (ansible_facts.distribution_major_version|int <= 5) - - not wazuh_agent_sources_installation.enabled - not wazuh_custom_packages_installation_agent_enabled register: repo_v5_installed diff --git a/roles/wazuh/ansible-wazuh-manager/tasks/Debian.yml b/roles/wazuh/ansible-wazuh-manager/tasks/Debian.yml index 5c21d115a..6764dcb5e 100644 --- a/roles/wazuh/ansible-wazuh-manager/tasks/Debian.yml +++ b/roles/wazuh/ansible-wazuh-manager/tasks/Debian.yml @@ -24,7 +24,6 @@ when: - ansible_facts.distribution == "Ubuntu" - ansible_facts.distribution_major_version | int == 14 - - not wazuh_manager_sources_installation.enabled - not wazuh_custom_packages_installation_manager_enabled - name: Debian/Ubuntu | Download Wazuh repository key @@ -49,7 +48,6 @@ mode: '0644' when: - not (ansible_facts.distribution == "Ubuntu" and ansible_facts.distribution_major_version | int == 14) - - not wazuh_manager_sources_installation.enabled - not wazuh_custom_packages_installation_manager_enabled - name: Debian/Ubuntu | Add Wazuh repositories diff --git a/roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml b/roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml index 5ce048a99..f0468dcf9 100644 --- a/roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml +++ b/roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml @@ -10,7 +10,6 @@ when: - (ansible_facts.os_family|lower == 'redhat') and (ansible_facts.distribution|lower != 'amazon') - (ansible_facts.distribution_major_version|int <= 5) - - not wazuh_manager_sources_installation.enabled - not wazuh_custom_packages_installation_manager_enabled register: repo_v5_manager_installed @@ -100,7 +99,6 @@ until: wazuh_manager_main_packages_installed is succeeded when: - ansible_facts.os_family|lower == "redhat" - - not wazuh_manager_sources_installation.enabled - not wazuh_custom_packages_installation_manager_enabled tags: - init From d7b942788365f5ed76e69d01c2b8b3cb69e1a96c Mon Sep 17 00:00:00 2001 From: Alex-Welsh Date: Wed, 8 Jan 2025 13:42:23 +0000 Subject: [PATCH 2/2] Fix use of ansible_system --- .../templates/var-ossec-etc-ossec-agent.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/wazuh/ansible-wazuh-agent/templates/var-ossec-etc-ossec-agent.conf.j2 b/roles/wazuh/ansible-wazuh-agent/templates/var-ossec-etc-ossec-agent.conf.j2 index 17e364275..7d6b170b9 100644 --- a/roles/wazuh/ansible-wazuh-agent/templates/var-ossec-etc-ossec-agent.conf.j2 +++ b/roles/wazuh/ansible-wazuh-agent/templates/var-ossec-etc-ossec-agent.conf.j2 @@ -30,7 +30,7 @@ {{ wazuh_profile_ubuntu }} {% endif %} {% endif %} - {% if ansible_system == "Darwin" %} + {% if ansible_facts.system == "Darwin" %} {{ wazuh_profile_macos }} {% endif %} {% if wazuh_notify_time is not none and wazuh_time_reconnect is not none %} @@ -67,7 +67,7 @@ {% if wazuh_agent_config.enrollment.agent_key_path | length > 0 %} {{ wazuh_agent_config.enrollment.agent_key_path }} {% endif %} - {% if wazuh_agent_config.enrollment.authorization_pass_path | length > 0 and ansible_system != "Darwin" %} + {% if wazuh_agent_config.enrollment.authorization_pass_path | length > 0 and ansible_facts.system != "Darwin" %} {{ wazuh_agent_config.enrollment.authorization_pass_path }} {% else %} {{ wazuh_agent_config.enrollment.authorization_pass_path_macos }}