From e8540fe16dc1d2b71a1cc57a8bbbc04f08a9367c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Tue, 3 Sep 2024 17:03:14 +0100 Subject: [PATCH 01/14] feat: remove warning from unexpected failures --- .../wazuh_testing/end_to_end/check_validators.py | 2 +- deps/wazuh_testing/wazuh_testing/end_to_end/logs.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/deps/wazuh_testing/wazuh_testing/end_to_end/check_validators.py b/deps/wazuh_testing/wazuh_testing/end_to_end/check_validators.py index aa33e5761f..30163ce429 100644 --- a/deps/wazuh_testing/wazuh_testing/end_to_end/check_validators.py +++ b/deps/wazuh_testing/wazuh_testing/end_to_end/check_validators.py @@ -158,7 +158,7 @@ def equals_but_not_empty(x, y): empty = lambda x: len(x) == 0 no_errors = lambda x: all( - not any(x[host][level] for level in ["ERROR", "CRITICAL", "WARNING"]) + not any(x[host][level] for level in ["ERROR", "CRITICAL"]) for host in x ) diff --git a/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py b/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py index 3369e3313e..f93e9ae4d4 100644 --- a/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py +++ b/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py @@ -67,7 +67,7 @@ def get_hosts_logs(host_manager: HostManager, host_group: str = 'all') -> Dict[s def check_errors_in_environment(host_manager: HostManager, greater_than_timestamp: str = '', - expected_errors: List[str] = None) -> dict: + expected_errors: List[str] = None, error_levels=['ERROR', 'CRITICAL', 'WARNING']) -> dict: """Check if there are errors in the environment Args: @@ -78,8 +78,6 @@ def check_errors_in_environment(host_manager: HostManager, greater_than_timestam Returns: dict: Errors found in the environment """ - - error_level_to_search = ['ERROR', 'CRITICAL', 'WARNING'] expected_errors = expected_errors or [] environment_logs = get_hosts_logs(host_manager) @@ -87,7 +85,7 @@ def check_errors_in_environment(host_manager: HostManager, greater_than_timestam for host, environment_log in environment_logs.items(): environment_level_logs[host] = {} - for level in error_level_to_search: + for level in error_levels: environment_level_logs[host][level] = [] regex = re.compile(fr'((\d{{4}}\/\d{{2}}\/\d{{2}} \d{{2}}:\d{{2}}:\d{{2}}) (.+): ({level}):(.*))') From 9f221221f15b074b64f1b1e9f6ff547d0592df1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Mon, 26 Aug 2024 14:23:55 +0100 Subject: [PATCH 02/14] fix: include timeout between agent and manager start --- .../test_vulnerability_detector.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py b/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py index 8b2f73b6f6..942fa539aa 100644 --- a/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py +++ b/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py @@ -81,6 +81,7 @@ FIRST_SCAN_TIME = None FIRST_SCAN_VULNERABILITIES_INDEX = {} AGENT_REGISTRATION_TIMEOUT = 15 +TIMEOUT_START_MANAGER = 60 VULNERABILITY_DETECTION_E2E_EXPECTED_ERRORS = [ r"Invalid ID \d{3} for the source", @@ -182,6 +183,9 @@ def configure_vulnerability_detection_test_environment( host_manager, vulnerability_detection_previously_enabled ) + # Wait for 1 minute to ensure all managers have fully started + time.sleep(TIMEOUT_START_MANAGER) + start_agent_and_wait_until_connected(host_manager) if not vulnerability_detection_previously_enabled: From 206292926d0e972077ed1cb5209cee8e6c16d20a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Tue, 3 Sep 2024 18:01:02 +0100 Subject: [PATCH 03/14] feat: change error levels to error and critical --- .../test_vulnerability_detector.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py b/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py index 942fa539aa..ab2bb080b5 100644 --- a/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py +++ b/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py @@ -375,7 +375,7 @@ def test_first_syscollector_scan( logging.critical("Checking for errors in the environment") unexpected_errors = check_errors_in_environment( - host_manager, expected_errors=VULNERABILITY_DETECTION_E2E_EXPECTED_ERRORS + host_manager, expected_errors=VULNERABILITY_DETECTION_E2E_EXPECTED_ERRORS, error_levels=['ERROR','CRITICAL'] ) test_result.validate_check( @@ -526,7 +526,7 @@ def test_syscollector_second_scan( unexpected_errors = check_errors_in_environment( host_manager, expected_errors=VULNERABILITY_DETECTION_E2E_EXPECTED_ERRORS, - greater_than_timestamp=get_timestamp, + greater_than_timestamp=get_timestamp, error_levels=['ERROR','CRITICAL'] ) test_result.validate_check( @@ -751,7 +751,7 @@ def test_install_vulnerable_package_when_agent_down(self, host_manager, request, errors_environment = check_errors_in_environment( host_manager, expected_errors=VULNERABILITY_DETECTION_E2E_EXPECTED_ERRORS, - greater_than_timestamp=test_timestamp, + greater_than_timestamp=test_timestamp, error_levels=['ERROR','CRITICAL'] ) test_result.validate_check("no_errors", [Evidence("error_level_messages", errors_environment)]) @@ -876,7 +876,7 @@ def test_change_agent_manager(self, permutate_agents_managers, request, precondi errors_environment = check_errors_in_environment( host_manager, expected_errors=VULNERABILITY_DETECTION_E2E_EXPECTED_ERRORS, - greater_than_timestamp=test_timestamp, + greater_than_timestamp=test_timestamp, error_levels=['ERROR','CRITICAL'] ) test_result.validate_check("no_errors", [Evidence("error_level_messages", errors_environment)]) @@ -1005,7 +1005,7 @@ def test_vulnerability_detector_scans_cases(self, request, preconditions, body, errors_environment = check_errors_in_environment( host_manager, expected_errors=VULNERABILITY_DETECTION_E2E_EXPECTED_ERRORS, - greater_than_timestamp=test_timestamp, + greater_than_timestamp=test_timestamp, error_levels=['ERROR','CRITICAL'] ) test_result.validate_check("no_errors", [Evidence("error_level_messages", errors_environment)]) From fd112a628874cbbb26481c83d9cc7c4369cba02b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Wed, 4 Sep 2024 10:26:24 +0100 Subject: [PATCH 04/14] refac: check_errors_in_environment function - Update docstring - Avoid mutable default parameters --- deps/wazuh_testing/wazuh_testing/end_to_end/logs.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py b/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py index f93e9ae4d4..2e34bf8dfa 100644 --- a/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py +++ b/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py @@ -67,18 +67,24 @@ def get_hosts_logs(host_manager: HostManager, host_group: str = 'all') -> Dict[s def check_errors_in_environment(host_manager: HostManager, greater_than_timestamp: str = '', - expected_errors: List[str] = None, error_levels=['ERROR', 'CRITICAL', 'WARNING']) -> dict: - """Check if there are errors in the environment + expected_errors: List[str] = None, + error_levels=None) -> dict: + """Check if there are errors in the environment. Args: host_manager (HostManager): An instance of the HostManager class. greater_than_timestamp (str): Timestamp to filter the logs expected_errors (List): List of expected errors. Default None + error_levels (List): List of the error levels to check. Default ['ERROR', 'CRITICAL', 'WARNING'] Returns: dict: Errors found in the environment """ - expected_errors = expected_errors or [] + default_error_levels = ['ERROR', 'WARNING', 'CRITICAL'] + if not expected_errors: + expected_errors = [] + if not error_levels: + expected_errors = default_error_levels environment_logs = get_hosts_logs(host_manager) environment_level_logs = {} From e8011020ed89d6456fc5e51a2e0838b9bf3000d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Wed, 4 Sep 2024 10:30:10 +0100 Subject: [PATCH 05/14] style: replace ' with " --- deps/wazuh_testing/wazuh_testing/end_to_end/check_validators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/wazuh_testing/wazuh_testing/end_to_end/check_validators.py b/deps/wazuh_testing/wazuh_testing/end_to_end/check_validators.py index 30163ce429..c40e742008 100644 --- a/deps/wazuh_testing/wazuh_testing/end_to_end/check_validators.py +++ b/deps/wazuh_testing/wazuh_testing/end_to_end/check_validators.py @@ -158,7 +158,7 @@ def equals_but_not_empty(x, y): empty = lambda x: len(x) == 0 no_errors = lambda x: all( - not any(x[host][level] for level in ["ERROR", "CRITICAL"]) + not any(x[host][level] for level in ['ERROR', 'CRITICAL']) for host in x ) From ad87046cc67c51e48d6db0f2697d821273fbac19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Wed, 4 Sep 2024 10:35:55 +0100 Subject: [PATCH 06/14] style: refactor to avoid code duplication --- .../test_vulnerability_detector.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py b/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py index ab2bb080b5..813286c409 100644 --- a/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py +++ b/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py @@ -82,6 +82,7 @@ FIRST_SCAN_VULNERABILITIES_INDEX = {} AGENT_REGISTRATION_TIMEOUT = 15 TIMEOUT_START_MANAGER = 60 +TESTS_UNEXPECTED_ERRORS_LEVELS = ['ERROR', 'CRITICAL'] VULNERABILITY_DETECTION_E2E_EXPECTED_ERRORS = [ r"Invalid ID \d{3} for the source", @@ -375,7 +376,7 @@ def test_first_syscollector_scan( logging.critical("Checking for errors in the environment") unexpected_errors = check_errors_in_environment( - host_manager, expected_errors=VULNERABILITY_DETECTION_E2E_EXPECTED_ERRORS, error_levels=['ERROR','CRITICAL'] + host_manager, expected_errors=VULNERABILITY_DETECTION_E2E_EXPECTED_ERRORS, error_levels=TESTS_UNEXPECTED_ERRORS_LEVELS ) test_result.validate_check( @@ -526,7 +527,7 @@ def test_syscollector_second_scan( unexpected_errors = check_errors_in_environment( host_manager, expected_errors=VULNERABILITY_DETECTION_E2E_EXPECTED_ERRORS, - greater_than_timestamp=get_timestamp, error_levels=['ERROR','CRITICAL'] + greater_than_timestamp=get_timestamp, error_levels=TESTS_UNEXPECTED_ERRORS_LEVELS ) test_result.validate_check( @@ -751,7 +752,7 @@ def test_install_vulnerable_package_when_agent_down(self, host_manager, request, errors_environment = check_errors_in_environment( host_manager, expected_errors=VULNERABILITY_DETECTION_E2E_EXPECTED_ERRORS, - greater_than_timestamp=test_timestamp, error_levels=['ERROR','CRITICAL'] + greater_than_timestamp=test_timestamp, error_levels=TESTS_UNEXPECTED_ERRORS_LEVELS ) test_result.validate_check("no_errors", [Evidence("error_level_messages", errors_environment)]) @@ -876,7 +877,7 @@ def test_change_agent_manager(self, permutate_agents_managers, request, precondi errors_environment = check_errors_in_environment( host_manager, expected_errors=VULNERABILITY_DETECTION_E2E_EXPECTED_ERRORS, - greater_than_timestamp=test_timestamp, error_levels=['ERROR','CRITICAL'] + greater_than_timestamp=test_timestamp, error_levels=TESTS_UNEXPECTED_ERRORS_LEVELS ) test_result.validate_check("no_errors", [Evidence("error_level_messages", errors_environment)]) @@ -1005,7 +1006,7 @@ def test_vulnerability_detector_scans_cases(self, request, preconditions, body, errors_environment = check_errors_in_environment( host_manager, expected_errors=VULNERABILITY_DETECTION_E2E_EXPECTED_ERRORS, - greater_than_timestamp=test_timestamp, error_levels=['ERROR','CRITICAL'] + greater_than_timestamp=test_timestamp, error_levels=TESTS_UNEXPECTED_ERRORS_LEVELS ) test_result.validate_check("no_errors", [Evidence("error_level_messages", errors_environment)]) From de86e716bcd96f19f83ad9615372586a6f111407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Wed, 4 Sep 2024 10:40:15 +0100 Subject: [PATCH 07/14] docs: include 5711 changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 991299ed9f..6559ec2301 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ All notable changes to this project will be documented in this file. - Added support for macOS 14.6 to the Allocation module (Vagrant) ([#5671](https://github.com/wazuh/wazuh-qa/pull/5671)) \- (Framework) +### Fixed +- Fix unexpected warnings in E2E vulnerability detection tests ([#5711](https://github.com/wazuh/wazuh-qa/pull/5711/)) \- (Test) + ## [4.9.0] - TBD ### Added From e74dbd052755abb02feefa3d8149e19620ac6e62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Wed, 4 Sep 2024 10:49:16 +0100 Subject: [PATCH 08/14] docs: fix typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6559ec2301..9fccccf261 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ All notable changes to this project will be documented in this file. - Added support for macOS 14.6 to the Allocation module (Vagrant) ([#5671](https://github.com/wazuh/wazuh-qa/pull/5671)) \- (Framework) ### Fixed -- Fix unexpected warnings in E2E vulnerability detection tests ([#5711](https://github.com/wazuh/wazuh-qa/pull/5711/)) \- (Test) +- Fix unexpected warnings in E2E vulnerability detection tests ([#5711](https://github.com/wazuh/wazuh-qa/pull/5711/)) \- (Tests) ## [4.9.0] - TBD From e55284e0aec054c2445928dfdb8ff5f2201ee281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Wed, 4 Sep 2024 10:50:47 +0100 Subject: [PATCH 09/14] docs: update docstring of check errors function --- deps/wazuh_testing/wazuh_testing/end_to_end/logs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py b/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py index 2e34bf8dfa..61a0421b72 100644 --- a/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py +++ b/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py @@ -75,7 +75,7 @@ def check_errors_in_environment(host_manager: HostManager, greater_than_timestam host_manager (HostManager): An instance of the HostManager class. greater_than_timestamp (str): Timestamp to filter the logs expected_errors (List): List of expected errors. Default None - error_levels (List): List of the error levels to check. Default ['ERROR', 'CRITICAL', 'WARNING'] + error_levels (List): List of the error levels to check. Default None. Returns: dict: Errors found in the environment From 4cfc4c10c0f8b19fc16cbde58a8f56b5547a2753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Wed, 4 Sep 2024 10:53:07 +0100 Subject: [PATCH 10/14] fix: replace expected_errors with error_level --- deps/wazuh_testing/wazuh_testing/end_to_end/logs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py b/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py index 61a0421b72..875e0539ca 100644 --- a/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py +++ b/deps/wazuh_testing/wazuh_testing/end_to_end/logs.py @@ -84,7 +84,7 @@ def check_errors_in_environment(host_manager: HostManager, greater_than_timestam if not expected_errors: expected_errors = [] if not error_levels: - expected_errors = default_error_levels + error_levels = default_error_levels environment_logs = get_hosts_logs(host_manager) environment_level_logs = {} From 916d90363faba037507efe9c6e590988b95a2115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Mon, 16 Sep 2024 11:12:01 +0100 Subject: [PATCH 11/14] docs: include framework type to changelog line Co-authored-by: Julia --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c531c9eb98..bb8f5c7681 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ All notable changes to this project will be documented in this file. - Added support for macOS 14.6 to the Allocation module (Vagrant) ([#5671](https://github.com/wazuh/wazuh-qa/pull/5671)) \- (Framework) ### Fixed -- Fix unexpected warnings in E2E vulnerability detection tests ([#5711](https://github.com/wazuh/wazuh-qa/pull/5711/)) \- (Tests) + +- Fix unexpected warnings in E2E vulnerability detection tests ([#5711](https://github.com/wazuh/wazuh-qa/pull/5711/)) \- (Framework + Tests) - Increase results windows in E2E Vulnerability detection ([#5712](https://github.com/wazuh/wazuh-qa/pull/5712/)) \- (Framework + Tests) ### Deleted From b37d69d1c5df341da4e8c59b03fcbaf59803067d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Mon, 16 Sep 2024 11:14:39 +0100 Subject: [PATCH 12/14] docs: remove final / in changelog line Co-authored-by: Julia --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb8f5c7681..94defc7c3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,8 @@ All notable changes to this project will be documented in this file. ### Fixed -- Fix unexpected warnings in E2E vulnerability detection tests ([#5711](https://github.com/wazuh/wazuh-qa/pull/5711/)) \- (Framework + Tests) -- Increase results windows in E2E Vulnerability detection ([#5712](https://github.com/wazuh/wazuh-qa/pull/5712/)) \- (Framework + Tests) +- Fix unexpected warnings in E2E vulnerability detection tests ([#5711](https://github.com/wazuh/wazuh-qa/pull/5711)) \- (Framework + Tests) +- Increase results windows in E2E Vulnerability detection ([#5712](https://github.com/wazuh/wazuh-qa/pull/5712)) \- (Framework + Tests) ### Deleted From fc02816c086fd52b84473080193a2076d638e520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Wed, 18 Sep 2024 09:58:11 +0100 Subject: [PATCH 13/14] docs: change fixed changelog order --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94defc7c3e..0edfb4f7b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,8 @@ All notable changes to this project will be documented in this file. ### Fixed -- Fix unexpected warnings in E2E vulnerability detection tests ([#5711](https://github.com/wazuh/wazuh-qa/pull/5711)) \- (Framework + Tests) - Increase results windows in E2E Vulnerability detection ([#5712](https://github.com/wazuh/wazuh-qa/pull/5712)) \- (Framework + Tests) +- Fix unexpected warnings in E2E vulnerability detection tests ([#5711](https://github.com/wazuh/wazuh-qa/pull/5711)) \- (Framework + Tests) ### Deleted From 08cf3521584f514fe0e3698e9e511ccba401d314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Wed, 18 Sep 2024 15:09:55 +0100 Subject: [PATCH 14/14] feat: include retry in manager provisioning task --- .../installation_from_custom_packages.yml | 48 ++++++++++++------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/provisioning/roles/wazuh/ansible-wazuh-manager/tasks/installation_from_custom_packages.yml b/provisioning/roles/wazuh/ansible-wazuh-manager/tasks/installation_from_custom_packages.yml index d5f120a24a..20e56a60fa 100644 --- a/provisioning/roles/wazuh/ansible-wazuh-manager/tasks/installation_from_custom_packages.yml +++ b/provisioning/roles/wazuh/ansible-wazuh-manager/tasks/installation_from_custom_packages.yml @@ -6,27 +6,39 @@ state: present when: - wazuh_custom_packages_installation_manager_enabled + register: wazuh_manager_installation + retries: 4 + delay: 30 + until: wazuh_manager_installation is succeeded when: - ansible_os_family|lower == "debian" - block: - - name: Install Wazuh Manager from .rpm packages | yum - yum: - name: "{{ wazuh_custom_packages_installation_manager_rpm_url }}" - state: present - when: - - wazuh_custom_packages_installation_manager_enabled - - not (ansible_distribution|lower == "centos" and ansible_distribution_major_version >= "8") - - not (ansible_distribution|lower == "redhat" and ansible_distribution_major_version >= "8") + - name: Install Wazuh Manager from .rpm packages | yum + yum: + name: "{{ wazuh_custom_packages_installation_manager_rpm_url }}" + state: present + when: + - wazuh_custom_packages_installation_manager_enabled + - not (ansible_distribution|lower == "centos" and ansible_distribution_major_version >= "8") + - not (ansible_distribution|lower == "redhat" and ansible_distribution_major_version >= "8") + register: wazuh_manager_installation_yum + retries: 4 + delay: 30 + until: wazuh_manager_installation_yum is succeeded - - name: Install Wazuh Manager from .rpm packages | dnf - dnf: - name: "{{ wazuh_custom_packages_installation_manager_rpm_url }}" - state: present - disable_gpg_check: True - when: - - wazuh_custom_packages_installation_manager_enabled - - (ansible_distribution|lower == "centos" and ansible_distribution_major_version >= "8") or - (ansible_distribution|lower == "redhat" and ansible_distribution_major_version >= "8") + - name: Install Wazuh Manager from .rpm packages | dnf + dnf: + name: "{{ wazuh_custom_packages_installation_manager_rpm_url }}" + state: present + disable_gpg_check: True + when: + - wazuh_custom_packages_installation_manager_enabled + - (ansible_distribution|lower == "centos" and ansible_distribution_major_version >= "8") or + (ansible_distribution|lower == "redhat" and ansible_distribution_major_version >= "8") + register: wazuh_manager_installation_dnf + retries: 4 + delay: 30 + until: wazuh_manager_installation_dnf is succeeded when: - - ansible_os_family|lower == "redhat" \ No newline at end of file + - ansible_os_family|lower == "redhat"