Showing with 47 additions and 32 deletions.
  1. +12 −1 CHANGELOG.md
  2. +3 −3 README.md
  3. +29 −25 manifests/repo.pp
  4. +1 −1 metadata.json
  5. +2 −2 spec/classes/filebeat_spec.rb
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@ Changelog
=========

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

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

**Fixed Bugs**
- Fix links in documentation to match the updated documentation

**New Features**
- Change repository resource names to beats (e.g. apt::source['beats'], etc.),
and only declare them if they haven't already been declared. This way we only
have one module for all beats modules managed through puppet.

## [v0.4.0](https://github.com/pcfens/puppet-filebeat/tree/v0.4.0)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v0.3.1...v0.4.0)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The only required parameter, other than which files to ship, is the `outputs` pa

All of the default values in filebeat follow the upstream defaults (at the time of writing).

To ship files to [elasticsearch](https://www.elastic.co/guide/en/beats/libbeat/1.0.0/configuration.html#_elasticsearch_output):
To ship files to [elasticsearch](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-configuration-details.html#elasticsearch-output):
```puppet
class { 'filebeat':
outputs => {
Expand All @@ -62,7 +62,7 @@ class { 'filebeat':
```

To ship log files through [logstash](https://www.elastic.co/guide/en/beats/libbeat/1.0.0/configuration.html#logstash-output):
To ship log files through [logstash](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-configuration-details.html#logstash-output):
```puppet
class { 'filebeat':
outputs => {
Expand All @@ -78,7 +78,7 @@ class { 'filebeat':
```

[Shipper](https://www.elastic.co/guide/en/beats/libbeat/1.0.0/configuration.html#configuration-shipper) and [logging](https://www.elastic.co/guide/en/beats/libbeat/1.0.0/configuration.html#configuration-logging) options can be configured the same way, and are documented on the [elastic website](https://www.elastic.co/guide/en/beats/libbeat/1.0.0/configuration.html).
[Shipper](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-configuration-details.html#configuration-shipper) and [logging](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-configuration-details.html#configuration-logging) options can be configured the same way, and are documented on the [elastic website](https://www.elastic.co/guide/en/beats/filebeat/current/index.html).

### Adding a prospector

Expand Down
54 changes: 29 additions & 25 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,45 @@
include ::apt
Class['apt::update'] -> Package['filebeat']

apt::source { 'filebeat':
location => 'http://packages.elastic.co/beats/apt',
release => 'stable',
repos => 'main',
key => {
id => '46095ACC8548582C1A2699A9D27D666CD88E42B4',
source => 'http://packages.elastic.co/GPG-KEY-elasticsearch',
},
if !defined(Apt::Source['beats']){
apt::source { 'beats':
location => 'http://packages.elastic.co/beats/apt',
release => 'stable',
repos => 'main',
key => {
id => '46095ACC8548582C1A2699A9D27D666CD88E42B4',
source => 'http://packages.elastic.co/GPG-KEY-elasticsearch',
},
}
}

}
'RedHat', 'Linux': {
yumrepo { 'filebeat':
descr => 'elasticsearch repo',
baseurl => 'https://packages.elastic.co/beats/yum/el/$basearch',
gpgcheck => 1,
gpgkey => 'http://packages.elastic.co/GPG-KEY-elasticsearch',
enabled => 1,
if !defined(Yumrepo['beats']){
yumrepo { 'beats':
descr => 'elasticsearch repo',
baseurl => 'https://packages.elastic.co/beats/yum/el/$basearch',
gpgcheck => 1,
gpgkey => 'http://packages.elastic.co/GPG-KEY-elasticsearch',
enabled => 1,
}
}
}
'Suse': {
exec { 'filebeat_suse_import_gpg':
exec { 'topbeat_suse_import_gpg':
command => 'rpmkeys --import http://packages.elastic.co/GPG-KEY-elasticsearch',
unless => 'test $(rpm -qa gpg-pubkey | grep -i "D88E42B4" | wc -l) -eq 1 ',
notify => [ Zypprepo['elasticsearch'] ],
}

zypprepo { 'filebeat':
baseurl => 'https://packages.elastic.co/beats/yum/el/$basearch',
enabled => 1,
autorefresh => 1,
name => 'elasticsearch',
gpgcheck => 1,
gpgkey => 'http://packages.elastic.co/GPG-KEY-elasticsearch',
type => 'yum',
if !defined(Zypprepo['beats']){
zypprepo { 'beats':
baseurl => 'https://packages.elastic.co/beats/yum/el/$basearch',
enabled => 1,
autorefresh => 1,
name => 'elasticsearch',
gpgcheck => 1,
gpgkey => 'http://packages.elastic.co/GPG-KEY-elasticsearch',
type => 'yum',
}
}
}
default: {
Expand Down
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.4.0",
"version": "0.4.1",
"author": "pcfens",
"license": "Apache-2.0",
"summary": "A module to install and manage the filebeat log shipper",
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/filebeat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
:enable => true,
:ensure => 'running',
)}
it { is_expected.to contain_apt__source('filebeat').with(
it { is_expected.to contain_apt__source('beats').with(
:location => 'http://packages.elastic.co/beats/apt',
:key => {
'id' => '46095ACC8548582C1A2699A9D27D666CD88E42B4',
Expand All @@ -44,7 +44,7 @@
}
end

it { is_expected.to contain_yumrepo('filebeat').with(
it { is_expected.to contain_yumrepo('beats').with(
:baseurl => 'https://packages.elastic.co/beats/yum/el/$basearch',
:gpgkey => 'http://packages.elastic.co/GPG-KEY-elasticsearch',
) }
Expand Down