From ede4d28771b5f509bfac36a0f1d893db9fa22124 Mon Sep 17 00:00:00 2001 From: James Lyons Date: Sat, 24 Feb 2018 23:35:28 -0500 Subject: [PATCH 1/2] add $config_hash to allow for setting filebeat.config settings like modules, etc --- manifests/config.pp | 2 ++ manifests/init.pp | 2 ++ manifests/params.pp | 1 + 3 files changed, 5 insertions(+) diff --git a/manifests/config.pp b/manifests/config.pp index 9be776b..7d2aa15 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -18,6 +18,7 @@ 'registry_file' => $filebeat::registry_file, 'config_dir' => $filebeat::config_dir, 'shutdown_timeout' => $filebeat::shutdown_timeout, + 'config' => $filebeat::config_hash, }, 'output' => $filebeat::outputs, 'shipper' => $filebeat::shipper, @@ -42,6 +43,7 @@ 'publish_async' => $filebeat::publish_async, 'config_dir' => $filebeat::config_dir, 'shutdown_timeout' => $filebeat::shutdown_timeout, + 'config' => $filebeat::config_hash, }, 'output' => $filebeat::outputs, 'shipper' => $filebeat::shipper, diff --git a/manifests/init.pp b/manifests/init.pp index 7164ac8..7e52767 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 config [Hash] Will be converted to YAML to create the optional config 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) @@ -69,6 +70,7 @@ Hash $outputs = $filebeat::params::outputs, Hash $shipper = $filebeat::params::shipper, Hash $logging = $filebeat::params::logging, + Hash $config_hash = $filebeat::params::config_hash, Hash $run_options = $filebeat::params::run_options, String $conf_template = $filebeat::params::conf_template, Optional[Pattern[/^(http(?:s)?\:\/\/[a-zA-Z0-9]+(?:(?:\.|\-)[a-zA-Z0-9]+)+(?:\:\d+)?(?:\/[\w\-\.]+)*(?:\/?|\/\w+\.[a-zA-Z]{2,4}(?:\?[\w]+\ = [\w\-]+)?)?(?:\&[\w]+\=[\w\-]+)*)$/]] $download_url = undef, # lint:ignore:140chars diff --git a/manifests/params.pp b/manifests/params.pp index 1102c9b..858d97f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -22,6 +22,7 @@ $outputs = {} $shipper = {} $logging = {} + $config_hash = {} $run_options = {} $kernel_fail_message = "${::kernel} is not supported by filebeat." $conf_template = "${module_name}/pure_hash.yml.erb" From fd8422004c4c1797433153f67dcf03bbe81ea9c1 Mon Sep 17 00:00:00 2001 From: James Lyons Date: Sat, 24 Feb 2018 23:52:35 -0500 Subject: [PATCH 2/2] add comment to README.md regarding use of filebeat::config_hash --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d393ce1..36fd8ec 100644 --- a/README.md +++ b/README.md @@ -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) +- `config_hash`: [Hash] Will be converted to YAML to create the optional filebeat.config 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)