Skip to content

Commit

Permalink
add support for features config section
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Nobiron committed Sep 7, 2023
1 parent 4cc5297 commit 32f50f0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
12 changes: 10 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,19 @@
})
# Add the 'xpack' section if supported (version >= 6.1.0) and not undef
if $filebeat::xpack and versioncmp($filebeat::package_ensure, '6.1.0') >= 0 {
$filebeat_config = deep_merge($filebeat_config_temp, { 'xpack' => $filebeat::xpack })
$filebeat_config_xpack = deep_merge($filebeat_config_temp, { 'xpack' => $filebeat::xpack })
}
else {
$filebeat_config = $filebeat_config_temp
$filebeat_config_xpack = $filebeat_config_temp
}
# Add the 'features' section if supported (version >= 8.7.0) and not undef
if $filebeat::features and versioncmp($filebeat::package_ensure, '8.7.0') >= 0 {
$filebeat_config = deep_merge($filebeat_config_xpack, { 'features' => $filebeat::features })
}
else {
$filebeat_config = $filebeat_config_xpack
}

} else {
$filebeat_config_temp = delete_undef_values({
'shutdown_timeout' => $filebeat::shutdown_timeout,
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
# @param modules_dir [String] The directory where module configurations should be defined (default: /etc/filebeat/modules.d)
# @param http [Hash] A hash of the http section of configuration
# @param cloud [Hash] Will be converted to YAML for the optional cloud of the configuration (see documentation, and above)
# @param features [Hash] Will be converted to YAML to create the optional features section of the filebeat config (see documentation)
# @param queue [Hash] Will be converted to YAML for the optional queue of the configuration (see documentation, and above)
# @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)
Expand Down Expand Up @@ -91,6 +92,7 @@
Boolean $enable_conf_modules = $filebeat::params::enable_conf_modules,
Hash $http = $filebeat::params::http,
Hash $cloud = $filebeat::params::cloud,
Hash $features = $filebeat::params::features,
Hash $queue = $filebeat::params::queue,
Hash $outputs = $filebeat::params::outputs,
Hash $shipper = $filebeat::params::shipper,
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 @@
$ssl = {}
$http = {}
$cloud = {}
$features = {}
$queue = {}
$outputs = {}
$shipper = {}
Expand Down

0 comments on commit 32f50f0

Please sign in to comment.