From f9450746188b41198f7b1f6e52b2dd56abab6a84 Mon Sep 17 00:00:00 2001 From: BrianMer <61540839+BrianMer@users.noreply.github.com> Date: Fri, 5 Apr 2024 14:20:07 +0200 Subject: [PATCH 1/2] Added Ansible task for GPG enrollment --- .../tasks/installation_from_custom_packages.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 aa50004f6..43184608e 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,6 +7,15 @@ - ansible_os_family|lower == "debian" - wazuh_custom_packages_installation_agent_enabled + - name: Add RPM GPG key + ansible.builtin.rpm_key: + key: "{{ wazuh_custom_packages_installation_agent_rpm_gpg_key_url }}" + when: + - ansible_os_family|lower == "redhat" + - 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") + - name: Install Wazuh Agent from .rpm packages | yum yum: name: "{{ wazuh_custom_packages_installation_agent_rpm_url }}" @@ -25,4 +34,4 @@ - 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") \ No newline at end of file + (ansible_distribution|lower == "redhat" and ansible_distribution_major_version >= "8") From b3411e246762c5872334fe4f3649d282cb2101f4 Mon Sep 17 00:00:00 2001 From: BrianMer <61540839+BrianMer@users.noreply.github.com> Date: Fri, 5 Apr 2024 14:24:01 +0200 Subject: [PATCH 2/2] Added var wazuh_custom_packages_installation_agent_rpm_gpg_key_url to main.yml Added the var wazuh_custom_packages_installation_agent_rpm_gpg_key_url in order to specify the location of the GPG key --- roles/wazuh/ansible-wazuh-agent/defaults/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/wazuh/ansible-wazuh-agent/defaults/main.yml b/roles/wazuh/ansible-wazuh-agent/defaults/main.yml index fb8ec3d7b..370390d4e 100644 --- a/roles/wazuh/ansible-wazuh-agent/defaults/main.yml +++ b/roles/wazuh/ansible-wazuh-agent/defaults/main.yml @@ -6,6 +6,7 @@ wazuh_agent_version: 5.0.0 wazuh_custom_packages_installation_agent_enabled: false wazuh_custom_packages_installation_agent_deb_url: "" wazuh_custom_packages_installation_agent_rpm_url: "" +wazuh_custom_packages_installation_agent_rpm_gpg_key_url: "" wazuh_agent_yum_lock_timeout: 30