Skip to content

Commit dca10f1

Browse files
committed
group unused parameters (logging)
1 parent 543c582 commit dca10f1

File tree

5 files changed

+68
-61
lines changed

5 files changed

+68
-61
lines changed

REFERENCE.md

+39-15
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,9 @@ copying files from the `configdir` to instance `configdir`s.
297297

298298
Data type: `String`
299299

300-
File pattern for the file appender log when file_rolling_type is 'dailyRollingFile'.
300+
UNUSED, File pattern for the file appender log when file_rolling_type is 'dailyRollingFile'.
301+
302+
Default value: `"'.'yyyy-MM-dd"`
301303

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

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

310312
Data type: `String`
311313

312-
Default logging level for Elasticsearch.
314+
UNUSED, Default logging level for Elasticsearch.
313315

314-
Default value: `$logging_level`
316+
Default value: `'INFO'`
315317

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

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

324326
Data type: `Boolean`
325327

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

331+
Default value: `false`
332+
329333
##### <a name="-elasticsearch--deprecation_logging_level"></a>`deprecation_logging_level`
330334

331335
Data type: `String`
332336

333-
Default deprecation logging level for Elasticsearch.
337+
UNUSED, Default deprecation logging level for Elasticsearch.
338+
339+
Default value: `'DEBUG'`
334340

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

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

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

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

382+
Default value: `'dailyRollingFile'`
383+
376384
##### <a name="-elasticsearch--homedir"></a>`homedir`
377385

378386
Data type: `Stdlib::Absolutepath`
@@ -449,28 +457,36 @@ Default value: `'2750'`
449457

450458
Data type: `Hash`
451459

452-
Representation of information to be included in the log4j.properties file.
460+
UNUSED, Representation of information to be included in the log4j.properties file.
461+
462+
Default value: `{}`
453463

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

456466
Data type: `Optional[String]`
457467

458-
Instead of a hash, you may supply a `puppet://` file source for the
468+
UNUSED, Instead of a hash, you may supply a `puppet://` file source for the
459469
log4j.properties file.
460470

471+
Default value: `undef`
472+
461473
##### <a name="-elasticsearch--logging_level"></a>`logging_level`
462474

463475
Data type: `String`
464476

465-
Default logging level for Elasticsearch.
477+
UNUSED, Default logging level for Elasticsearch.
478+
479+
Default value: `'INFO'`
466480

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

469-
Data type: `Optional[String]`
483+
Data type: `String`
470484

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

488+
Default value: `"${module_name}/etc/elasticsearch/log4j2.properties.erb"`
489+
474490
##### <a name="-elasticsearch--manage_datadir"></a>`manage_datadir`
475491

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

663679
Data type: `Integer`
664680

665-
Max number of logs to store whern file_rolling_type is 'rollingFile'
681+
UNUSED, Max number of logs to store whern file_rolling_type is 'rollingFile'
682+
683+
Default value: `1`
666684

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

669687
Data type: `String`
670688

671-
Max log file size when file_rolling_type is 'rollingFile'
689+
UNUSED, Max log file size when file_rolling_type is 'rollingFile'
690+
691+
Default value: `'10MB'`
672692

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

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

688708
Data type: `Optional[String]`
689709

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

713+
Default value: `undef`
714+
693715
##### <a name="-elasticsearch--security_logging_source"></a>`security_logging_source`
694716

695717
Data type: `Optional[String]`
696718

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

722+
Default value: `undef`
723+
700724
##### <a name="-elasticsearch--service_name"></a>`service_name`
701725

702726
Data type: `String`

data/common.yaml

-14
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,11 @@ elasticsearch::autoupgrade: false
1111
elasticsearch::config: {}
1212
elasticsearch::configdir: "/etc/elasticsearch"
1313
elasticsearch::configdir_recurselimit: 2
14-
elasticsearch::default_logging_level: INFO
15-
elasticsearch::daily_rolling_date_pattern: |
16-
"'.'yyyy-MM-dd"
1714
elasticsearch::defaults_location:
18-
elasticsearch::deprecation_logging: false
19-
elasticsearch::deprecation_logging_level: DEBUG
2015
elasticsearch::download_tool:
2116
elasticsearch::download_tool_insecure:
2217
elasticsearch::download_tool_verify_certificates: true
2318
elasticsearch::ensure: present
24-
elasticsearch::file_rolling_type: dailyRollingFile
2519
elasticsearch::indices: {}
2620
elasticsearch::init_defaults: {}
2721
elasticsearch::init_defaults_file:
@@ -30,10 +24,6 @@ elasticsearch::instances: {}
3024
elasticsearch::jvm_options: []
3125
elasticsearch::license:
3226
elasticsearch::logdir: "/var/log/elasticsearch"
33-
elasticsearch::logging_config: {}
34-
elasticsearch::logging_file:
35-
elasticsearch::logging_level: INFO
36-
elasticsearch::logging_template:
3727
elasticsearch::manage_datadir: true
3828
elasticsearch::manage_logdir: true
3929
elasticsearch::manage_repo: true
@@ -53,12 +43,8 @@ elasticsearch::purge_secrets: false
5343
elasticsearch::repo_stage: false
5444
elasticsearch::restart_on_change: false
5545
elasticsearch::roles: {}
56-
elasticsearch::rolling_file_max_backup_index: 1
57-
elasticsearch::rolling_file_max_file_size: 10MB
5846
elasticsearch::scripts: {}
5947
elasticsearch::secrets:
60-
elasticsearch::security_logging_content:
61-
elasticsearch::security_logging_source:
6248
elasticsearch::service_name: elasticsearch
6349
elasticsearch::service_provider: systemd
6450
elasticsearch::snapshot_repositories: {}

manifests/config.pp

+1-5
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,7 @@
145145
# if ($elasticsearch::logging_file != undef) {
146146
# $_log4j_content = undef
147147
# } else {
148-
# if ($elasticsearch::logging_template != undef ) {
149-
# $_log4j_content = template($elasticsearch::logging_template)
150-
# } else {
151-
# $_log4j_content = template("${module_name}/etc/elasticsearch/log4j2.properties.erb")
152-
# }
148+
# $_log4j_content = template($elasticsearch::logging_template)
153149
# $_logging_source = undef
154150
# }
155151
# file {

manifests/init.pp

+27-26
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,23 @@
7777
# copying files from the `configdir` to instance `configdir`s.
7878
#
7979
# @param daily_rolling_date_pattern
80-
# File pattern for the file appender log when file_rolling_type is 'dailyRollingFile'.
80+
# UNUSED, File pattern for the file appender log when file_rolling_type is 'dailyRollingFile'.
8181
#
8282
# @param datadir
8383
# Allows you to set the data directory of Elasticsearch.
8484
#
8585
# @param default_logging_level
86-
# Default logging level for Elasticsearch.
86+
# UNUSED, Default logging level for Elasticsearch.
8787
#
8888
# @param defaults_location
8989
# Absolute path to directory containing init defaults file.
9090
#
9191
# @param deprecation_logging
92-
# Whether to enable deprecation logging. If enabled, deprecation logs will be
92+
# UNUSED, Whether to enable deprecation logging. If enabled, deprecation logs will be
9393
# saved to ${cluster.name}_deprecation.log in the Elasticsearch log folder.
9494
#
9595
# @param deprecation_logging_level
96-
# Default deprecation logging level for Elasticsearch.
96+
# UNUSED, Default deprecation logging level for Elasticsearch.
9797
#
9898
# @param download_tool
9999
# Command-line invocation with which to retrieve an optional package_url.
@@ -114,7 +114,7 @@
114114
# The user Elasticsearch should run as. This also sets file ownership.
115115
#
116116
# @param file_rolling_type
117-
# Configuration for the file appender rotation. It can be 'dailyRollingFile',
117+
# UNUSED, Configuration for the file appender rotation. It can be 'dailyRollingFile',
118118
# 'rollingFile' or 'file'. The first rotates by name, the second one by size
119119
# or third don't rotate automatically.
120120
#
@@ -152,17 +152,17 @@
152152
# Mode directory that will be used for Elasticsearch logging (default 2750).
153153
#
154154
# @param logging_config
155-
# Representation of information to be included in the log4j.properties file.
155+
# UNUSED, Representation of information to be included in the log4j.properties file.
156156
#
157157
# @param logging_file
158-
# Instead of a hash, you may supply a `puppet://` file source for the
158+
# UNUSED, Instead of a hash, you may supply a `puppet://` file source for the
159159
# log4j.properties file.
160160
#
161161
# @param logging_level
162-
# Default logging level for Elasticsearch.
162+
# UNUSED, Default logging level for Elasticsearch.
163163
#
164164
# @param logging_template
165-
# Use a custom logging template - just supply the relative path, i.e.
165+
# UNUSED, Use a custom logging template - just supply the relative path, i.e.
166166
# `$module/elasticsearch/logging.yml.erb`
167167
#
168168
# @param manage_datadir
@@ -268,10 +268,10 @@
268268
# Define roles via a hash. This is mainly used with Hiera's auto binding.
269269
#
270270
# @param rolling_file_max_backup_index
271-
# Max number of logs to store whern file_rolling_type is 'rollingFile'
271+
# UNUSED, Max number of logs to store whern file_rolling_type is 'rollingFile'
272272
#
273273
# @param rolling_file_max_file_size
274-
# Max log file size when file_rolling_type is 'rollingFile'
274+
# UNUSED, Max log file size when file_rolling_type is 'rollingFile'
275275
#
276276
# @param scripts
277277
# Define scripts via a hash. This is mainly used with Hiera's auto binding.
@@ -281,11 +281,11 @@
281281
# Elasticsearch keystore file. If unset, the keystore is left unmanaged.
282282
#
283283
# @param security_logging_content
284-
# File content for x-pack logging configuration file (will be placed
284+
# UNUSED, File content for x-pack logging configuration file (will be placed
285285
# into log4j2.properties file).
286286
#
287287
# @param security_logging_source
288-
# File source for x-pack logging configuration file (will be placed
288+
# UNUSED, File source for x-pack logging configuration file (will be placed
289289
# into log4j2.properties).
290290
#
291291
# @param service_name
@@ -361,17 +361,13 @@
361361
Hash $config,
362362
Stdlib::Absolutepath $configdir,
363363
Integer $configdir_recurselimit,
364-
String $daily_rolling_date_pattern,
365364
Elasticsearch::Multipath $datadir,
366365
Optional[Stdlib::Absolutepath] $defaults_location,
367-
Boolean $deprecation_logging,
368-
String $deprecation_logging_level,
369366
Optional[String] $download_tool,
370367
Optional[String] $download_tool_insecure,
371368
Boolean $download_tool_verify_certificates,
372369
String $elasticsearch_group,
373370
String $elasticsearch_user,
374-
Enum['dailyRollingFile', 'rollingFile', 'file'] $file_rolling_type,
375371
Stdlib::Absolutepath $homedir,
376372
Hash $indices,
377373
Hash $init_defaults,
@@ -380,10 +376,6 @@
380376
Array[String] $jvm_options,
381377
Optional[Variant[String, Hash]] $license,
382378
Stdlib::Absolutepath $logdir,
383-
Hash $logging_config,
384-
Optional[String] $logging_file,
385-
String $logging_level,
386-
Optional[String] $logging_template,
387379
Boolean $manage_datadir,
388380
Boolean $manage_logdir,
389381
Boolean $manage_repo,
@@ -404,12 +396,8 @@
404396
Variant[Boolean, String] $repo_stage,
405397
Boolean $restart_on_change,
406398
Hash $roles,
407-
Integer $rolling_file_max_backup_index,
408-
String $rolling_file_max_file_size,
409399
Hash $scripts,
410400
Optional[Hash] $secrets,
411-
Optional[String] $security_logging_content,
412-
Optional[String] $security_logging_source,
413401
String $service_name,
414402
Enum['init', 'openbsd', 'openrc', 'systemd'] $service_provider,
415403
Hash $snapshot_repositories,
@@ -427,7 +415,6 @@
427415
Hash $slm_policies = {},
428416
Optional[Stdlib::Absolutepath] $ca_certificate = undef,
429417
Optional[Stdlib::Absolutepath] $certificate = undef,
430-
String $default_logging_level = $logging_level,
431418
Optional[String] $keystore_password = undef,
432419
Optional[Stdlib::Absolutepath] $keystore_path = undef,
433420
Optional[Stdlib::Absolutepath] $private_key = undef,
@@ -436,6 +423,20 @@
436423
Boolean $restart_package_change = $restart_on_change,
437424
Boolean $restart_plugin_change = $restart_on_change,
438425
Stdlib::Filemode $logdir_mode = '2750',
426+
# Deprecated (not used)
427+
String $daily_rolling_date_pattern = "'.'yyyy-MM-dd",
428+
String $default_logging_level = 'INFO',
429+
Enum['dailyRollingFile', 'rollingFile', 'file'] $file_rolling_type = 'dailyRollingFile',
430+
Hash $logging_config = {},
431+
Optional[String] $logging_file = undef,
432+
String $logging_level = 'INFO',
433+
String $logging_template = "${module_name}/etc/elasticsearch/log4j2.properties.erb",
434+
Boolean $deprecation_logging = false,
435+
String $deprecation_logging_level = 'DEBUG',
436+
Integer $rolling_file_max_backup_index = 1,
437+
String $rolling_file_max_file_size = '10MB',
438+
Optional[String] $security_logging_content = undef,
439+
Optional[String] $security_logging_source = undef,
439440
) {
440441
#### Validate parameters
441442

templates/etc/elasticsearch/log4j2.properties.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ appender.deprecation_rolling.strategy.max = 4
5959

6060
logger.deprecation.name = org.elasticsearch.deprecation
6161
<%- if scope['elasticsearch::deprecation_logging'] -%>
62-
logger.deprecation.level = <%= scope['elasitcsearch::deprecation_logging_level'].downcase %>
62+
logger.deprecation.level = <%= scope['elasticsearch::deprecation_logging_level'].downcase %>
6363
<%- else -%>
6464
logger.deprecation.level = warn
6565
<%- end -%>

0 commit comments

Comments
 (0)