Use 'wazuh_repo' variable instead of 'filebeatrepo'

This commit is contained in:
Jesus Garcia 2025-04-14 10:06:12 -05:00
parent 6525691769
commit da6d2c34a0
No known key found for this signature in database
GPG Key ID: 8461CA78326C96C9
6 changed files with 15 additions and 19 deletions

View File

@ -15,7 +15,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- Update the Filebeat installation for arm64 to include revision ([#x](https://github.com/wazuh/wazuh-ansible/pull/x))
- Update the Filebeat installation for arm64 to include revision ([#1616](https://github.com/wazuh/wazuh-ansible/pull/1616))
### Deleted

View File

@ -20,10 +20,3 @@ filebeat_ssl_dir: /etc/pki/filebeat
# Local path to store the generated certificates (Opensearch security plugin)
local_certs_path: "{{ playbook_dir }}/indexer/certificates"
filebeatrepo:
keyring_path: '/usr/share/keyrings/wazuh.gpg'
apt: "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main"
yum: 'https://packages.wazuh.com/4.x/yum/'
gpg: 'https://packages.wazuh.com/key/GPG-KEY-WAZUH'
path: '/tmp/WAZUH-GPG-KEY'

View File

@ -11,22 +11,22 @@
- name: Debian/Ubuntu | Download Filebeat apt key.
get_url:
url: "{{ filebeatrepo.gpg }}"
dest: "{{ filebeatrepo.path }}"
url: "{{ wazuh_repo.gpg }}"
dest: "{{ wazuh_repo.path }}"
- name: Import Filebeat GPG key
command: "gpg --no-default-keyring --keyring gnupg-ring:{{ filebeatrepo.keyring_path }} --import {{ filebeatrepo.path }}"
command: "gpg --no-default-keyring --keyring gnupg-ring:{{ wazuh_repo.keyring_path }} --import {{ wazuh_repo.path }}"
args:
creates: "{{ filebeatrepo.keyring_path }}"
creates: "{{ wazuh_repo.keyring_path }}"
- name: Set permissions for Filebeat GPG key
file:
path: "{{ filebeatrepo.keyring_path }}"
path: "{{ wazuh_repo.keyring_path }}"
mode: '0644'
- name: Debian/Ubuntu | Add Filebeat-oss repository.
apt_repository:
repo: "{{ filebeatrepo.apt }}"
repo: "{{ wazuh_repo.apt }}"
state: present
update_cache: true
changed_when: false

View File

@ -1,6 +1,6 @@
---
- name: Debian/Ubuntu | Remove Filebeat repository (and clean up left-over metadata)
apt_repository:
repo: "{{ filebeatrepo.apt }}"
repo: "{{ wazuh_repo.apt }}"
state: absent
changed_when: false

View File

@ -3,7 +3,7 @@
yum_repository:
name: wazuh_repo
description: Wazuh Repo
baseurl: "{{ filebeatrepo.yum }}"
gpgkey: "{{ filebeatrepo.gpg }}"
baseurl: "{{ wazuh_repo.yum }}"
gpgkey: "{{ wazuh_repo.gpg }}"
gpgcheck: true
changed_when: false

View File

@ -7,6 +7,9 @@
- include_vars: ../../vars/repo_pre-release.yml
when: packages_repository == 'pre-release'
- include_vars: ../../vars/repo_staging.yml
when: packages_repository == 'staging'
- include_tasks: RedHat.yml
when: ansible_os_family == 'RedHat'
@ -15,7 +18,7 @@
- name: Install Filebeat | Redhat
yum:
name: "filebeat-{{ filebeat_version }}-1"
name: "filebeat-{{ filebeat_version }}"
state: present
lock_timeout: 200
register: install
@ -26,7 +29,7 @@
- name: Install Filebeat | Debian
apt:
name: "filebeat={{ filebeat_version }}-1"
name: "filebeat={{ filebeat_version }}-*"
state: present
register: install
tags: