diff --git a/roles/wazuh/ansible-wazuh-agent/tasks/installation_from_custom_packages.yml b/roles/wazuh/ansible-wazuh-agent/tasks/installation_from_custom_packages.yml index 01ce540c..ddd9b50d 100644 --- a/roles/wazuh/ansible-wazuh-agent/tasks/installation_from_custom_packages.yml +++ b/roles/wazuh/ansible-wazuh-agent/tasks/installation_from_custom_packages.yml @@ -7,10 +7,24 @@ - ansible_os_family|lower == "debian" - wazuh_custom_packages_installation_agent_enabled - - name: Install Wazuh Agent from .rpm packages + - name: Install Wazuh Agent from .rpm packages | yum yum: name: "{{ wazuh_custom_packages_installation_agent_rpm_url }}" state: present when: - ansible_os_family|lower == "redhat" - - wazuh_custom_packages_installation_agent_enabled \ No newline at end of file + - wazuh_custom_packages_installation_agent_enabled + - not (ansible_distribution|lower == "centos" and ansible_distribution_major_version >= "8") + - not (ansible_distribution|lower == "redhat" and ansible_distribution_major_version >= "8") + - not (ansible_distribution|lower == "amazon" and ansible_distribution_major_version >= "2") + + - name: Install Wazuh Agent from .rpm packages | dnf + dnf: + name: "{{ wazuh_custom_packages_installation_agent_rpm_url }}" + state: present + when: + - ansible_os_family|lower == "redhat" + - wazuh_custom_packages_installation_agent_enabled + - (ansible_distribution|lower == "centos" and ansible_distribution_major_version >= "8") or + (ansible_distribution|lower == "redhat" and ansible_distribution_major_version >= "8") or + (ansible_distribution|lower == "amazon" and ansible_distribution_major_version >= "2") \ No newline at end of file