Showing with 20 additions and 7 deletions.
  1. +7 −1 CHANGELOG.md
  2. +2 −2 manifests/config.pp
  3. +2 −0 manifests/init.pp
  4. +2 −2 manifests/params.pp
  5. +1 −1 metadata.json
  6. +6 −0 spec/acceptance/001_basic_spec.rb
  7. +0 −1 templates/filebeat.yml.erb
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ Changelog
=========

## Unreleased
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v0.8.6...HEAD)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v0.8.7...HEAD)

## [v0.8.7](https://github.com/pcfens/puppet-filebeat/tree/v0.8.7)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v0.8.6...v0.8.7)

- Update windows URL to the latest 5.x release
- Remove nil values before rendering the template [\#65](https://github.com/pcfens/puppet-filebeat/pull/65)

## [v0.8.6](https://github.com/pcfens/puppet-filebeat/tree/v0.8.6)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v0.8.5...v0.8.6)
Expand Down
4 changes: 2 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class filebeat::config {
$filebeat_config = {
$filebeat_config = delete_undef_values({
'shutdown_timeout' => $filebeat::shutdown_timeout,
'beat_name' => $filebeat::beat_name,
'tags' => $filebeat::tags,
Expand All @@ -19,7 +19,7 @@
'shipper' => $filebeat::shipper,
'logging' => $filebeat::logging,
'runoptions' => $filebeat::run_options,
}
})

case $::kernel {
'Linux' : {
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
$prospectors_merge = false,
) inherits filebeat::params {

include stdlib

$kernel_fail_message = "${::kernel} is not supported by filebeat."

validate_bool($manage_repo, $prospectors_merge)
Expand Down
4 changes: 2 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@
'Windows' : {
$config_file = 'C:/Program Files/Filebeat/filebeat.yml'
$config_dir = 'C:/Program Files/Filebeat/conf.d'
$download_url = 'https://download.elastic.co/beats/filebeat/filebeat-1.3.1-windows.zip'
$download_url = 'https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.0.2-windows-x86_64.zip'
$install_dir = 'C:/Program Files'
$tmp_dir = 'C:/Windows/Temp'
$service_provider = undef
}

default : {
fail($filebeat::kernel_fail_message)
fail("${::kernel} is not supported by filebeat.")
}
}
}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pcfens-filebeat",
"version": "0.8.6",
"version": "0.8.7",
"author": "pcfens",
"license": "Apache-2.0",
"summary": "A module to install and manage the filebeat log shipper",
Expand Down
6 changes: 6 additions & 0 deletions spec/acceptance/001_basic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,11 @@ class { 'filebeat':
describe package(package_name) do
it { should be_installed }
end

describe file('/etc/filebeat/filebeat.yml') do
it { should be_file }
it { should contain('---') }
it { should_not contain('max_procs: !ruby') }
end
end
end
1 change: 0 additions & 1 deletion templates/filebeat.yml.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<%- filebeat_config = @filebeat_config.delete_if { |key, value| !defined?(value) } -%>
<%- @filebeat_config['filebeat']['spool_size'] = Integer(@filebeat_config['filebeat']['spool_size']) -%>
<%- if @filebeat_config['output']['file'] -%>
<%- if @filebeat_config['output']['file']['rotate_every_kb'] -%>
Expand Down