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 aa58ca1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 45 deletions.
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
51 changes: 26 additions & 25 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'.
# DEPRECATED, 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.
# DEPRECATED, 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
# DEPRECATED, 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.
# DEPRECATED, 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',
# DEPRECATED, 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.
# DEPRECATED, 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
# DEPRECATED, Instead of a hash, you may supply a `puppet://` file source for the
# log4j.properties file.
#
# @param logging_level
# Default logging level for Elasticsearch.
#
# @param logging_template
# Use a custom logging template - just supply the relative path, i.e.
# DEPRECATED, 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'
# DEPRECATED, 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'
# DEPRECATED, 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
# DEPRECATED, 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
# DEPRECATED, 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 aa58ca1

Please sign in to comment.