Showing with 22 additions and 5 deletions.
  1. +6 −1 CHANGELOG.md
  2. +1 −0 README.md
  3. +9 −1 manifests/config.pp
  4. +2 −0 manifests/init.pp
  5. +1 −0 manifests/params.pp
  6. +3 −3 metadata.json
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ Changelog
=========

## Unreleased
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v3.0.1...HEAD)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v3.1.0...HEAD)

## [v3.1.0](https://github.com/pcfens/puppet-filebeat/tree/v3.1.0)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v3.0.1...v3.1.0)

- Manage filebeat modules as an array [\#168](https://github.com/pcfens/puppet-filebeat/pull/168)

## [v3.0.1](https://github.com/pcfens/puppet-filebeat/tree/v3.0.1)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v3.0.0...v3.0.1)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ Installs and configures filebeat.
- `outputs`: [Hash] Will be converted to YAML for the required outputs section of the configuration (see documentation, and above)
- `shipper`: [Hash] Will be converted to YAML to create the optional shipper section of the filebeat config (see documentation)
- `logging`: [Hash] Will be converted to YAML to create the optional logging section of the filebeat config (see documentation)
- `modules`: [Array] Will be converted to YAML to create the optional modules section of the filebeat config (see documentation)
- `conf_template`: [String] The configuration template to use to generate the main filebeat.yml config file.
- `download_url`: [String] The URL of the zip file that should be downloaded to install filebeat (windows only)
- `install_dir`: [String] Where filebeat should be installed (windows only)
Expand Down
10 changes: 9 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
'path' => "${filebeat::config_dir}/*.yml",
},
'shutdown_timeout' => $filebeat::shutdown_timeout,
'modules' => $filebeat::modules,
},
'output' => $filebeat::outputs,
'shipper' => $filebeat::shipper,
Expand All @@ -30,7 +31,7 @@
'setup' => $filebeat::setup,
})
} else {
$filebeat_config = delete_undef_values({
$filebeat_config_temp = delete_undef_values({
'shutdown_timeout' => $filebeat::shutdown_timeout,
'name' => $filebeat::beat_name,
'tags' => $filebeat::tags,
Expand All @@ -52,6 +53,13 @@
'runoptions' => $filebeat::run_options,
'processors' => $filebeat::processors,
})
# Add the 'modules' section if supported (version >= 5.2.0)
if versioncmp($filebeat::package_ensure, '5.2.0') >= 0 {
$filebeat_config = deep_merge($filebeat_config_temp, {'modules' => $filebeat::modules})
}
else {
$filebeat_config = $filebeat_config_temp
}
}

if $::filebeat_version {
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
# @param outputs [Hash] Will be converted to YAML for the required outputs section of the configuration (see documentation, and above)
# @param shipper [Hash] Will be converted to YAML to create the optional shipper section of the filebeat config (see documentation)
# @param logging [Hash] Will be converted to YAML to create the optional logging section of the filebeat config (see documentation)
# @param modules [Array] Will be converted to YAML to create the optional modules section of the filebeat config (see documentation)
# @param conf_template [String] The configuration template to use to generate the main filebeat.yml config file
# @param download_url [String] The URL of the zip file that should be downloaded to install filebeat (windows only)
# @param install_dir [String] Where filebeat should be installed (windows only)
Expand Down Expand Up @@ -85,6 +86,7 @@
Array $processors = [],
Hash $prospectors = {},
Hash $setup = {},
Array $modules = [],
Optional[Variant[Stdlib::HTTPUrl, Stdlib::HTTPSUrl]] $proxy_address = undef, # lint:ignore:140chars
Stdlib::Absolutepath $filebeat_path = $filebeat::params::filebeat_path
) inherits filebeat::params {
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
$shipper = {}
$logging = {}
$run_options = {}
$modules = []
$kernel_fail_message = "${::kernel} is not supported by filebeat."
$osfamily_fail_message = "${::osfamily} is not supported by filebeat."
$conf_template = "${module_name}/pure_hash.yml.erb"
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pcfens-filebeat",
"version": "3.0.1",
"version": "3.1.0",
"author": "pcfens",
"summary": "A module to install and manage the filebeat log shipper",
"license": "Apache-2.0",
Expand Down Expand Up @@ -67,9 +67,9 @@
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"12.04",
"14.04",
"16.04"
"16.04",
"18.04"
]
},
{
Expand Down