Skip to content

Commit

Permalink
feat: migrate filebeat url logic to inventory schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebits committed Feb 14, 2024
1 parent 82ca219 commit 8d4c1fe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
16 changes: 2 additions & 14 deletions provisioning/roles/wazuh/ansible-filebeat-oss/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,11 @@
path: "{{ filebeat_module_folder }}"
register: filebeat_module_folder

- name: Download pre-release Filebeat module package
get_url:
url: "{{ filebeat_module_pre_release_package_url }}/{{ filebeat_module_package_name }}"
dest: "{{ filebeat_module_package_path }}"
when: not filebeat_module_folder.stat.exists and repository == "pre-release"

- name: Download staging Filebeat module package
get_url:
url: "{{ filebeat_module_staging_package_url }}/{{ filebeat_module_package_name }}"
dest: "{{ filebeat_module_package_path }}"
when: not filebeat_module_folder.stat.exists and repository == "staging"

- name: Download production Filebeat module package
- name: Download Filebeat module package
get_url:
url: "{{ filebeat_module_package_url }}/{{ filebeat_module_package_name }}"
dest: "{{ filebeat_module_package_path }}"
when: not filebeat_module_folder.stat.exists and repository == "live"
when: not filebeat_module_folder.stat.exists

- name: Unpack Filebeat module package
unarchive:
Expand Down
12 changes: 11 additions & 1 deletion provisioning/roles/wazuh/wazuh_environment/schema.j2
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,21 @@ wazuh_custom_packages_installation_indexer_rpm_url: {{ role_parameters['wazuh_cu
{% endif %}

{% if role == 'filebeat' %}
{% if role_parameters['filebeat_repo'] is defined%}
{% if role_parameters['filebeat_repo'] is defined %}
filebeat_module_package_url: {{ role_parameters['filebeat_repo'] }}
{% else %}
{% if repository == 'pre-release' %}
filebeat_module_package_url: https://packages-dev.wazuh.com/pre-release/filebeat
{% elif repository == 'live' %}
filebeat_module_package_url: https://packages.wazuh.com/4.x/filebeat
{% elif repository == 'staging' %}
filebeat_module_package_url: https://packages-dev.wazuh.com/staging/filebeat
{% endif %}
{% endif %}
{% endif %}



{%- endmacro -%}

{% if indexer is defined%}
Expand Down

0 comments on commit 8d4c1fe

Please sign in to comment.