diff --git a/README.md b/README.md index 4b8f325..e7c40eb 100644 --- a/README.md +++ b/README.md @@ -317,6 +317,7 @@ Installs and configures filebeat. - `setup`: [Hash] Setup that will be created. Commonly used to create setup using hiera - `xpack`: [Hash] XPack configuration to pass to filebeat - `extra_validate_options`: [String] Extra command line options to pass to the configuration validation command. +- `overwrite_pipelines`: [Boolean] If set to true, filebeat will overwrite existing pipelines. ### Private Classes diff --git a/manifests/config.pp b/manifests/config.pp index f5508c9..a7b781e 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -33,9 +33,10 @@ 'enabled' => $filebeat::enable_conf_modules, 'path' => "${filebeat::modules_dir}/*.yml", }, - 'shutdown_timeout' => $filebeat::shutdown_timeout, - 'modules' => $filebeat::modules, - 'registry' => { + 'modules' => $filebeat::modules, + 'overwrite_pipelines' => $filebeat::overwrite_pipelines, + 'shutdown_timeout' => $filebeat::shutdown_timeout, + 'registry' => { 'path' => $filebeat::registry_path, 'file_permissions' => $filebeat::registry_file_permissions, 'flush' => $filebeat::registry_flush, @@ -69,12 +70,13 @@ 'fields' => $filebeat::fields, 'fields_under_root' => $filebeat::fields_under_root, 'filebeat' => { - 'spool_size' => $filebeat::spool_size, - 'idle_timeout' => $filebeat::idle_timeout, - 'registry_file' => $filebeat::registry_file, - 'publish_async' => $filebeat::publish_async, - 'config_dir' => $filebeat::config_dir, - 'shutdown_timeout' => $filebeat::shutdown_timeout, + 'config_dir' => $filebeat::config_dir, + 'idle_timeout' => $filebeat::idle_timeout, + 'overwrite_pipelines' => $filebeat::overwrite_pipelines, + 'publish_async' => $filebeat::publish_async, + 'registry_file' => $filebeat::registry_file, + 'shutdown_timeout' => $filebeat::shutdown_timeout, + 'spool_size' => $filebeat::spool_size, }, 'output' => $filebeat::outputs, 'shipper' => $filebeat::shipper, diff --git a/manifests/init.pp b/manifests/init.pp index 6ccfa27..6c82ad0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -52,6 +52,7 @@ # @param xpack [Hash] Configuration items to export internal stats to a monitoring Elasticsearch cluster # @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) +# @param overwrite_pipelines [Boolean] If set to true filebeat will overwrite (ingest) pipeline in Elasticsearch class filebeat ( String $package_ensure = $filebeat::params::package_ensure, Boolean $manage_package = $filebeat::params::manage_package, @@ -113,6 +114,7 @@ Optional[String] $registry_path = $filebeat::params::registry_path, Optional[String] $registry_file_permissions = $filebeat::params::registry_file_permissions, Optional[String] $registry_flush = $filebeat::params::registry_flush, + Boolean $overwrite_pipelines = $filebeat::params::overwrite_pipelines, ) inherits filebeat::params { diff --git a/manifests/params.pp b/manifests/params.pp index 9ecd08e..97529fa 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -28,6 +28,7 @@ $autodiscover = {} $run_options = {} $modules = [] + $overwrite_pipelines = false $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" diff --git a/templates/filebeat.yml.erb b/templates/filebeat.yml.erb index feb782b..e0b66f7 100644 --- a/templates/filebeat.yml.erb +++ b/templates/filebeat.yml.erb @@ -6,6 +6,7 @@ filebeat.publish_async: <%= @filebeat_config['filebeat']['publish_async'] %> filebeat.idle_timeout: <%= @filebeat_config['filebeat']['idle_timeout'] %> <% end -%> filebeat.config_dir: <%= @filebeat_config['filebeat']['config_dir'] %> +filebeat.overwrite_pipelines: <%= @filebeat_config['filebeat']['overwrite_pipelines'] %> filebeat.shutdown_timeout: <%= @filebeat_config['filebeat']['shutdown_timeout'] %> filebeat.registry.path: <%= @filebeat_config['filebeat']['registry']['path'] %> filebeat.registry.file_permissions: <%= @filebeat_config['filebeat']['registry']['file_permissions'] %>