Showing with 47 additions and 13 deletions.
  1. +2 −2 .travis.yml
  2. +11 −1 CHANGELOG.md
  3. +3 −3 README.md
  4. +1 −0 manifests/init.pp
  5. +13 −4 manifests/params.pp
  6. +3 −2 manifests/service.pp
  7. +1 −1 metadata.json
  8. +13 −0 spec/classes/filebeat_spec.rb
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rvm:
- 2.0.0
env:
- PUPPET_GEM_VERSION="~> 3.5.1"
- PUPPET_GEM_VERSION="~> 3.8.4"
- PUPPET_GEM_VERSION="~> 4.3.1"
- PUPPET_GEM_VERSION="~> 3.8.6"
- PUPPET_GEM_VERSION="~> 4.4.0"
notifications:
email: false
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@ Changelog
=========

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

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

**Fixed Bugs**
- `doc_type` is now used in the documentation instead of the deprecated `log_type`
[\#17](https://github.com/pcfens/puppet-filebeat/pull/17)
- RedHat based systems should be using the redhat service provider.
[\#18](https://github.com/pcfens/puppet-filebeat/pull/18)


## [v0.5.7](https://github.com/pcfens/puppet-filebeat/tree/v0.5.7)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v0.5.6...v0.5.7)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ be defined as a hash added to the class declaration (also used for automatically
prospectors using hiera), or as their own defined resources.

At a minimum, the `paths` parameter must be set to an array of files or blobs that should
be shipped. `log_type` is what logstash views as the type parameter if you'd like to
be shipped. `doc_type` is what logstash views as the type parameter if you'd like to
apply conditional filters.

```puppet
Expand All @@ -96,7 +96,7 @@ filebeat::prospector { 'syslogs':
'/var/log/auth.log',
'/var/log/syslog',
],
log_type => 'syslog-beat',
doc_type => 'syslog-beat',
}
```

Expand Down Expand Up @@ -195,7 +195,7 @@ to fully understand what these parameters do.
- `fields`: [Hash] Optional fields to add information to the output (default: {})
- `fields_under_root`: [Boolean] Should the `fields` parameter fields be stored at the top level of indexed documents.
- `ignore_older`: [String] Files older than this field will be ignored by filebeat (default: 24h)
- `log_type`: [String] (Deprecated - use `doc_type`) The document_type setting (optional - default: log)
- `log_type`: [String] \(Deprecated - use `doc_type`\) The document_type setting (optional - default: log)
- `doc_type`: [String] The event type to used for published lines, used as type field in logstash
and elasticsearch (optional - default: log)
- `scan_frequency`: [String] How often should the prospector check for new files (default: 10s)
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
$manage_repo = $filebeat::params::manage_repo,
$service_ensure = $filebeat::params::service_ensure,
$service_enable = $filebeat::params::service_enable,
$service_provider = $filebeat::params::service_provider,
$spool_size = $filebeat::params::spool_size,
$idle_timeout = $filebeat::params::idle_timeout,
$registry_file = $filebeat::params::registry_file,
Expand Down
17 changes: 13 additions & 4 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,22 @@
$tmp_dir = '/tmp'
$install_dir = undef
$download_url = undef
case $::osfamily {
'RedHat': {
$service_provider = 'redhat'
}
default: {
$service_provider = undef
}
}
}

'Windows' : {
$config_dir = 'C:/Program Files/Filebeat/conf.d'
$download_url = 'https://download.elastic.co/beats/filebeat/filebeat-1.0.1-windows.zip'
$install_dir = 'C:/Program Files'
$tmp_dir = 'C:/Temp'
$config_dir = 'C:/Program Files/Filebeat/conf.d'
$download_url = 'https://download.elastic.co/beats/filebeat/filebeat-1.0.1-windows.zip'
$install_dir = 'C:/Program Files'
$tmp_dir = 'C:/Temp'
$service_provider = undef
}

default : {
Expand Down
5 changes: 3 additions & 2 deletions manifests/service.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class filebeat::service {
service { 'filebeat':
ensure => $filebeat::service_ensure,
enable => $filebeat::service_enable,
ensure => $filebeat::service_ensure,
enable => $filebeat::service_enable,
provider => $filebeat::service_provider,
}
}
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.5.7",
"version": "0.5.8",
"author": "pcfens",
"license": "Apache-2.0",
"summary": "A module to install and manage the filebeat log shipper",
Expand Down
13 changes: 13 additions & 0 deletions spec/classes/filebeat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
it { is_expected.to contain_service('filebeat').with(
:enable => true,
:ensure => 'running',
:provider => nil, # Provider should use the resource default
)}
it { is_expected.to contain_apt__source('beats').with(
:location => 'http://packages.elastic.co/beats/apt',
Expand All @@ -48,6 +49,13 @@
:baseurl => 'https://packages.elastic.co/beats/yum/el/$basearch',
:gpgkey => 'http://packages.elastic.co/GPG-KEY-elasticsearch',
) }

it { is_expected.to contain_service('filebeat').with(
:enable => true,
:ensure => 'running',
:provider => 'redhat',
)}

end

describe 'on a Windows system' do
Expand All @@ -65,6 +73,11 @@
:path => 'C:/Program Files/Filebeat/conf.d',
:recurse => true,
)}
it { is_expected.to contain_service('filebeat').with(
:enable => true,
:ensure => 'running',
:provider => nil, # Provider should use the resource default
)}
end


Expand Down