From 26b41ce35edf3177425092e9ecb547401e1b2be2 Mon Sep 17 00:00:00 2001 From: Jose M Date: Wed, 12 Jun 2019 11:04:35 +0200 Subject: [PATCH] Add versionig to filebeat recipe. --- cookbooks/wazuh_filebeat/recipes/filebeat.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cookbooks/wazuh_filebeat/recipes/filebeat.rb b/cookbooks/wazuh_filebeat/recipes/filebeat.rb index fd63ed6a..8e68c92f 100644 --- a/cookbooks/wazuh_filebeat/recipes/filebeat.rb +++ b/cookbooks/wazuh_filebeat/recipes/filebeat.rb @@ -5,8 +5,19 @@ include_recipe 'wazuh_filebeat::repository' -package 'filebeat' do - version node['filebeat']['elastic_stack_version'] +if platform_family?('debian', 'ubuntu') + + apt_package 'filebeat' do + version "#{node['wazuh-elastic']['elastic_stack_version']}" + end + +elsif platform_family?('rhel', 'redhat', 'centos', 'amazon') + yum_package 'filebeat' do + version "#{node['wazuh-elastic']['elastic_stack_version']}-1" + end + +else + raise "Currently platforn not supported yet. Feel free to open an issue on https://www.github.com/wazuh/wazuh-chef if you consider that support for a specific OS should be added" end bash 'Elasticsearch_template' do