Skip to content

Commit

Permalink
group unused parameters (logging)
Browse files Browse the repository at this point in the history
  • Loading branch information
stjmt committed Jul 31, 2024
1 parent 543c582 commit dca10f1
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 61 deletions.
54 changes: 39 additions & 15 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ copying files from the `configdir` to instance `configdir`s.

Data type: `String`

File pattern for the file appender log when file_rolling_type is 'dailyRollingFile'.
UNUSED, File pattern for the file appender log when file_rolling_type is 'dailyRollingFile'.

Default value: `"'.'yyyy-MM-dd"`

##### <a name="-elasticsearch--datadir"></a>`datadir`

Expand All @@ -309,9 +311,9 @@ Allows you to set the data directory of Elasticsearch.

Data type: `String`

Default logging level for Elasticsearch.
UNUSED, Default logging level for Elasticsearch.

Default value: `$logging_level`
Default value: `'INFO'`

##### <a name="-elasticsearch--defaults_location"></a>`defaults_location`

Expand All @@ -323,14 +325,18 @@ Absolute path to directory containing init defaults file.

Data type: `Boolean`

Whether to enable deprecation logging. If enabled, deprecation logs will be
UNUSED, Whether to enable deprecation logging. If enabled, deprecation logs will be
saved to ${cluster.name}_deprecation.log in the Elasticsearch log folder.

Default value: `false`

##### <a name="-elasticsearch--deprecation_logging_level"></a>`deprecation_logging_level`

Data type: `String`

Default deprecation logging level for Elasticsearch.
UNUSED, Default deprecation logging level for Elasticsearch.

Default value: `'DEBUG'`

##### <a name="-elasticsearch--download_tool"></a>`download_tool`

Expand Down Expand Up @@ -369,10 +375,12 @@ The user Elasticsearch should run as. This also sets file ownership.

Data type: `Enum['dailyRollingFile', 'rollingFile', 'file']`

Configuration for the file appender rotation. It can be 'dailyRollingFile',
UNUSED, Configuration for the file appender rotation. It can be 'dailyRollingFile',
'rollingFile' or 'file'. The first rotates by name, the second one by size
or third don't rotate automatically.

Default value: `'dailyRollingFile'`

##### <a name="-elasticsearch--homedir"></a>`homedir`

Data type: `Stdlib::Absolutepath`
Expand Down Expand Up @@ -449,28 +457,36 @@ Default value: `'2750'`

Data type: `Hash`

Representation of information to be included in the log4j.properties file.
UNUSED, Representation of information to be included in the log4j.properties file.

Default value: `{}`

##### <a name="-elasticsearch--logging_file"></a>`logging_file`

Data type: `Optional[String]`

Instead of a hash, you may supply a `puppet://` file source for the
UNUSED, Instead of a hash, you may supply a `puppet://` file source for the
log4j.properties file.

Default value: `undef`

##### <a name="-elasticsearch--logging_level"></a>`logging_level`

Data type: `String`

Default logging level for Elasticsearch.
UNUSED, Default logging level for Elasticsearch.

Default value: `'INFO'`

##### <a name="-elasticsearch--logging_template"></a>`logging_template`

Data type: `Optional[String]`
Data type: `String`

Use a custom logging template - just supply the relative path, i.e.
UNUSED, Use a custom logging template - just supply the relative path, i.e.
`$module/elasticsearch/logging.yml.erb`

Default value: `"${module_name}/etc/elasticsearch/log4j2.properties.erb"`

##### <a name="-elasticsearch--manage_datadir"></a>`manage_datadir`

Data type: `Boolean`
Expand Down Expand Up @@ -662,13 +678,17 @@ Define roles via a hash. This is mainly used with Hiera's auto binding.

Data type: `Integer`

Max number of logs to store whern file_rolling_type is 'rollingFile'
UNUSED, Max number of logs to store whern file_rolling_type is 'rollingFile'

Default value: `1`

##### <a name="-elasticsearch--rolling_file_max_file_size"></a>`rolling_file_max_file_size`

Data type: `String`

Max log file size when file_rolling_type is 'rollingFile'
UNUSED, Max log file size when file_rolling_type is 'rollingFile'

Default value: `'10MB'`

##### <a name="-elasticsearch--scripts"></a>`scripts`

Expand All @@ -687,16 +707,20 @@ Elasticsearch keystore file. If unset, the keystore is left unmanaged.

Data type: `Optional[String]`

File content for x-pack logging configuration file (will be placed
UNUSED, File content for x-pack logging configuration file (will be placed
into log4j2.properties file).

Default value: `undef`

##### <a name="-elasticsearch--security_logging_source"></a>`security_logging_source`

Data type: `Optional[String]`

File source for x-pack logging configuration file (will be placed
UNUSED, File source for x-pack logging configuration file (will be placed
into log4j2.properties).

Default value: `undef`

##### <a name="-elasticsearch--service_name"></a>`service_name`

Data type: `String`
Expand Down
14 changes: 0 additions & 14 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,11 @@ elasticsearch::autoupgrade: false
elasticsearch::config: {}
elasticsearch::configdir: "/etc/elasticsearch"
elasticsearch::configdir_recurselimit: 2
elasticsearch::default_logging_level: INFO
elasticsearch::daily_rolling_date_pattern: |
"'.'yyyy-MM-dd"
elasticsearch::defaults_location:
elasticsearch::deprecation_logging: false
elasticsearch::deprecation_logging_level: DEBUG
elasticsearch::download_tool:
elasticsearch::download_tool_insecure:
elasticsearch::download_tool_verify_certificates: true
elasticsearch::ensure: present
elasticsearch::file_rolling_type: dailyRollingFile
elasticsearch::indices: {}
elasticsearch::init_defaults: {}
elasticsearch::init_defaults_file:
Expand All @@ -30,10 +24,6 @@ elasticsearch::instances: {}
elasticsearch::jvm_options: []
elasticsearch::license:
elasticsearch::logdir: "/var/log/elasticsearch"
elasticsearch::logging_config: {}
elasticsearch::logging_file:
elasticsearch::logging_level: INFO
elasticsearch::logging_template:
elasticsearch::manage_datadir: true
elasticsearch::manage_logdir: true
elasticsearch::manage_repo: true
Expand All @@ -53,12 +43,8 @@ elasticsearch::purge_secrets: false
elasticsearch::repo_stage: false
elasticsearch::restart_on_change: false
elasticsearch::roles: {}
elasticsearch::rolling_file_max_backup_index: 1
elasticsearch::rolling_file_max_file_size: 10MB
elasticsearch::scripts: {}
elasticsearch::secrets:
elasticsearch::security_logging_content:
elasticsearch::security_logging_source:
elasticsearch::service_name: elasticsearch
elasticsearch::service_provider: systemd
elasticsearch::snapshot_repositories: {}
Expand Down
6 changes: 1 addition & 5 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,7 @@
# if ($elasticsearch::logging_file != undef) {
# $_log4j_content = undef
# } else {
# if ($elasticsearch::logging_template != undef ) {
# $_log4j_content = template($elasticsearch::logging_template)
# } else {
# $_log4j_content = template("${module_name}/etc/elasticsearch/log4j2.properties.erb")
# }
# $_log4j_content = template($elasticsearch::logging_template)
# $_logging_source = undef
# }
# file {
Expand Down
53 changes: 27 additions & 26 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,23 @@
# copying files from the `configdir` to instance `configdir`s.
#
# @param daily_rolling_date_pattern
# File pattern for the file appender log when file_rolling_type is 'dailyRollingFile'.
# UNUSED, File pattern for the file appender log when file_rolling_type is 'dailyRollingFile'.
#
# @param datadir
# Allows you to set the data directory of Elasticsearch.
#
# @param default_logging_level
# Default logging level for Elasticsearch.
# UNUSED, Default logging level for Elasticsearch.
#
# @param defaults_location
# Absolute path to directory containing init defaults file.
#
# @param deprecation_logging
# Whether to enable deprecation logging. If enabled, deprecation logs will be
# UNUSED, Whether to enable deprecation logging. If enabled, deprecation logs will be
# saved to ${cluster.name}_deprecation.log in the Elasticsearch log folder.
#
# @param deprecation_logging_level
# Default deprecation logging level for Elasticsearch.
# UNUSED, Default deprecation logging level for Elasticsearch.
#
# @param download_tool
# Command-line invocation with which to retrieve an optional package_url.
Expand All @@ -114,7 +114,7 @@
# The user Elasticsearch should run as. This also sets file ownership.
#
# @param file_rolling_type
# Configuration for the file appender rotation. It can be 'dailyRollingFile',
# UNUSED, Configuration for the file appender rotation. It can be 'dailyRollingFile',
# 'rollingFile' or 'file'. The first rotates by name, the second one by size
# or third don't rotate automatically.
#
Expand Down Expand Up @@ -152,17 +152,17 @@
# Mode directory that will be used for Elasticsearch logging (default 2750).
#
# @param logging_config
# Representation of information to be included in the log4j.properties file.
# UNUSED, Representation of information to be included in the log4j.properties file.
#
# @param logging_file
# Instead of a hash, you may supply a `puppet://` file source for the
# UNUSED, Instead of a hash, you may supply a `puppet://` file source for the
# log4j.properties file.
#
# @param logging_level
# Default logging level for Elasticsearch.
# UNUSED, Default logging level for Elasticsearch.
#
# @param logging_template
# Use a custom logging template - just supply the relative path, i.e.
# UNUSED, Use a custom logging template - just supply the relative path, i.e.
# `$module/elasticsearch/logging.yml.erb`
#
# @param manage_datadir
Expand Down Expand Up @@ -268,10 +268,10 @@
# Define roles via a hash. This is mainly used with Hiera's auto binding.
#
# @param rolling_file_max_backup_index
# Max number of logs to store whern file_rolling_type is 'rollingFile'
# UNUSED, Max number of logs to store whern file_rolling_type is 'rollingFile'
#
# @param rolling_file_max_file_size
# Max log file size when file_rolling_type is 'rollingFile'
# UNUSED, Max log file size when file_rolling_type is 'rollingFile'
#
# @param scripts
# Define scripts via a hash. This is mainly used with Hiera's auto binding.
Expand All @@ -281,11 +281,11 @@
# Elasticsearch keystore file. If unset, the keystore is left unmanaged.
#
# @param security_logging_content
# File content for x-pack logging configuration file (will be placed
# UNUSED, File content for x-pack logging configuration file (will be placed
# into log4j2.properties file).
#
# @param security_logging_source
# File source for x-pack logging configuration file (will be placed
# UNUSED, File source for x-pack logging configuration file (will be placed
# into log4j2.properties).
#
# @param service_name
Expand Down Expand Up @@ -361,17 +361,13 @@
Hash $config,
Stdlib::Absolutepath $configdir,
Integer $configdir_recurselimit,
String $daily_rolling_date_pattern,
Elasticsearch::Multipath $datadir,
Optional[Stdlib::Absolutepath] $defaults_location,
Boolean $deprecation_logging,
String $deprecation_logging_level,
Optional[String] $download_tool,
Optional[String] $download_tool_insecure,
Boolean $download_tool_verify_certificates,
String $elasticsearch_group,
String $elasticsearch_user,
Enum['dailyRollingFile', 'rollingFile', 'file'] $file_rolling_type,
Stdlib::Absolutepath $homedir,
Hash $indices,
Hash $init_defaults,
Expand All @@ -380,10 +376,6 @@
Array[String] $jvm_options,
Optional[Variant[String, Hash]] $license,
Stdlib::Absolutepath $logdir,
Hash $logging_config,
Optional[String] $logging_file,
String $logging_level,
Optional[String] $logging_template,
Boolean $manage_datadir,
Boolean $manage_logdir,
Boolean $manage_repo,
Expand All @@ -404,12 +396,8 @@
Variant[Boolean, String] $repo_stage,
Boolean $restart_on_change,
Hash $roles,
Integer $rolling_file_max_backup_index,
String $rolling_file_max_file_size,
Hash $scripts,
Optional[Hash] $secrets,
Optional[String] $security_logging_content,
Optional[String] $security_logging_source,
String $service_name,
Enum['init', 'openbsd', 'openrc', 'systemd'] $service_provider,
Hash $snapshot_repositories,
Expand All @@ -427,7 +415,6 @@
Hash $slm_policies = {},
Optional[Stdlib::Absolutepath] $ca_certificate = undef,
Optional[Stdlib::Absolutepath] $certificate = undef,
String $default_logging_level = $logging_level,
Optional[String] $keystore_password = undef,
Optional[Stdlib::Absolutepath] $keystore_path = undef,
Optional[Stdlib::Absolutepath] $private_key = undef,
Expand All @@ -436,6 +423,20 @@
Boolean $restart_package_change = $restart_on_change,
Boolean $restart_plugin_change = $restart_on_change,
Stdlib::Filemode $logdir_mode = '2750',
# Deprecated (not used)
String $daily_rolling_date_pattern = "'.'yyyy-MM-dd",
String $default_logging_level = 'INFO',
Enum['dailyRollingFile', 'rollingFile', 'file'] $file_rolling_type = 'dailyRollingFile',
Hash $logging_config = {},
Optional[String] $logging_file = undef,
String $logging_level = 'INFO',
String $logging_template = "${module_name}/etc/elasticsearch/log4j2.properties.erb",
Boolean $deprecation_logging = false,
String $deprecation_logging_level = 'DEBUG',
Integer $rolling_file_max_backup_index = 1,
String $rolling_file_max_file_size = '10MB',
Optional[String] $security_logging_content = undef,
Optional[String] $security_logging_source = undef,
) {
#### Validate parameters

Expand Down
2 changes: 1 addition & 1 deletion templates/etc/elasticsearch/log4j2.properties.erb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ appender.deprecation_rolling.strategy.max = 4

logger.deprecation.name = org.elasticsearch.deprecation
<%- if scope['elasticsearch::deprecation_logging'] -%>
logger.deprecation.level = <%= scope['elasitcsearch::deprecation_logging_level'].downcase %>
logger.deprecation.level = <%= scope['elasticsearch::deprecation_logging_level'].downcase %>
<%- else -%>
logger.deprecation.level = warn
<%- end -%>
Expand Down

0 comments on commit dca10f1

Please sign in to comment.