Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,18 @@
'monitoring' => $filebeat::monitoring,
'setup' => $setup,
})
# Add the migration.6_to_7.enabled section, if requested:
if $filebeat::migrate_67 {
$filebeat_config_temp_migrate = deep_merge($filebeat_config_temp, { 'migration.6_to_7.enabled' => true })
} else {
$filebeat_config_temp_migrate = $filebeat_config_temp
}
# 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 = deep_merge($filebeat_config_temp_migrate, {'xpack' => $filebeat::xpack})
}
else {
$filebeat_config = $filebeat_config_temp
$filebeat_config = $filebeat_config_temp_migrate
}
} else {
$filebeat_config_temp = delete_undef_values({
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
# @param inputs_merge [Boolean] Whether $inputs should merge all hiera sources, or use simple automatic parameter lookup
# proxy_address [String] Proxy server to use for downloading files
# @param xpack [Hash] Configuration items to export internal stats to a monitoring Elasticsearch cluster
# @param migrate_67 [Boolean] Decides whether to add the migration.6_to_7.enabled setting (default: false)
# @param extra_validate_options [String] Extra command line options to pass to the configuration validation command
# @param autodiscover [Hash] Will be converted to YAML for the optional autodiscover section of the configuration (see documentation, and above)
class filebeat (
Expand Down Expand Up @@ -91,6 +92,7 @@
Hash $fields = $filebeat::params::fields,
Boolean $fields_under_root = $filebeat::params::fields_under_root,
Boolean $disable_config_test = $filebeat::params::disable_config_test,
Boolean $migrate_67 = $filebeat::params::migrate_67,
Array $processors = [],
Optional[Hash] $monitoring = undef,
Variant[Hash, Array] $inputs = {},
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
$conf_template = "${module_name}/pure_hash.yml.erb"
$disable_config_test = false
$xpack = undef
$migrate_67 = false
$systemd_override_dir = '/etc/systemd/system/filebeat.service.d'
$systemd_beat_log_opts_template = "${module_name}/systemd/logging.conf.erb"

Expand Down