|
298 | 298 | # Value type is string
|
299 | 299 | # Default value: undef
|
300 | 300 | #
|
| 301 | +# [*file_rolling_type*] |
| 302 | +# Configuration for the file appender rotation. It can be 'dailyRollingFile' |
| 303 | +# or 'rollingFile'. The first rotates by name, and the second one by size. |
| 304 | +# Value type is string |
| 305 | +# Default value: dailyRollingFile |
| 306 | +# |
| 307 | +# [*daily_rolling_date_pattern*] |
| 308 | +# File pattern for the file appender log when file_rolling_type is 'dailyRollingFile' |
| 309 | +# Value type is string |
| 310 | +# Default value: "'.'yyyy-MM-dd" |
| 311 | +# |
| 312 | +# [*rolling_file_max_backup_index*] |
| 313 | +# Max number of logs to store whern file_rolling_type is 'rollingFile' |
| 314 | +# Value type is integer |
| 315 | +# Default value: 1 |
| 316 | +# |
| 317 | +# [*rolling_file_max_file_size*] |
| 318 | +# Max log file size when file_rolling_type is 'rollingFile' |
| 319 | +# Value type is string |
| 320 | +# Default value: 10MB |
| 321 | +# |
301 | 322 | # The default values for the parameters are set in elasticsearch::params. Have
|
302 | 323 | # a look at the corresponding <tt>params.pp</tt> manifest file if you need more
|
303 | 324 | # technical information about them.
|
|
323 | 344 | # * Richard Pijnenburg <mailto:[email protected]>
|
324 | 345 | #
|
325 | 346 | class elasticsearch(
|
326 |
| - $ensure = $elasticsearch::params::ensure, |
327 |
| - $status = $elasticsearch::params::status, |
328 |
| - $restart_on_change = $elasticsearch::params::restart_on_change, |
329 |
| - $restart_config_change = $elasticsearch::restart_on_change, |
330 |
| - $restart_package_change = $elasticsearch::restart_on_change, |
331 |
| - $restart_plugin_change = $elasticsearch::restart_on_change, |
332 |
| - $autoupgrade = $elasticsearch::params::autoupgrade, |
333 |
| - $version = false, |
334 |
| - $package_provider = 'package', |
335 |
| - $package_url = undef, |
336 |
| - $package_dir = $elasticsearch::params::package_dir, |
337 |
| - $package_name = $elasticsearch::params::package, |
338 |
| - $package_pin = true, |
339 |
| - $purge_package_dir = $elasticsearch::params::purge_package_dir, |
340 |
| - $package_dl_timeout = $elasticsearch::params::package_dl_timeout, |
341 |
| - $proxy_url = undef, |
342 |
| - $elasticsearch_user = $elasticsearch::params::elasticsearch_user, |
343 |
| - $elasticsearch_group = $elasticsearch::params::elasticsearch_group, |
344 |
| - $configdir = $elasticsearch::params::configdir, |
345 |
| - $purge_configdir = $elasticsearch::params::purge_configdir, |
346 |
| - $service_provider = 'init', |
347 |
| - $init_defaults = undef, |
348 |
| - $init_defaults_file = undef, |
349 |
| - $init_template = "${module_name}/etc/init.d/${elasticsearch::params::init_template}", |
350 |
| - $config = undef, |
351 |
| - $config_hiera_merge = false, |
352 |
| - $datadir = $elasticsearch::params::datadir, |
353 |
| - $logdir = $elasticsearch::params::logdir, |
354 |
| - $plugindir = $elasticsearch::params::plugindir, |
355 |
| - $java_install = false, |
356 |
| - $java_package = undef, |
357 |
| - $manage_repo = false, |
358 |
| - $repo_version = undef, |
359 |
| - $repo_priority = undef, |
360 |
| - $repo_key_id = '46095ACC8548582C1A2699A9D27D666CD88E42B4', |
361 |
| - $repo_key_source = 'http://packages.elastic.co/GPG-KEY-elasticsearch', |
362 |
| - $repo_proxy = undef, |
363 |
| - $logging_file = undef, |
364 |
| - $logging_config = undef, |
365 |
| - $logging_template = undef, |
366 |
| - $default_logging_level = $elasticsearch::params::default_logging_level, |
367 |
| - $repo_stage = false, |
368 |
| - $instances = undef, |
369 |
| - $instances_hiera_merge = false, |
370 |
| - $plugins = undef, |
371 |
| - $plugins_hiera_merge = false, |
372 |
| - $use_ssl = undef, |
373 |
| - $validate_ssl = undef, |
374 |
| - $ssl_user = undef, |
375 |
| - $ssl_password = undef, |
376 |
| - $api_protocol = 'http', |
377 |
| - $api_host = 'localhost', |
378 |
| - $api_port = 9200, |
379 |
| - $api_timeout = 10, |
380 |
| - $api_basic_auth_username = undef, |
381 |
| - $api_basic_auth_password = undef, |
382 |
| - $api_ca_file = undef, |
383 |
| - $api_ca_path = undef, |
384 |
| - $validate_tls = true, |
385 |
| - $system_key = undef, |
| 347 | + $ensure = $elasticsearch::params::ensure, |
| 348 | + $status = $elasticsearch::params::status, |
| 349 | + $restart_on_change = $elasticsearch::params::restart_on_change, |
| 350 | + $restart_config_change = $elasticsearch::restart_on_change, |
| 351 | + $restart_package_change = $elasticsearch::restart_on_change, |
| 352 | + $restart_plugin_change = $elasticsearch::restart_on_change, |
| 353 | + $autoupgrade = $elasticsearch::params::autoupgrade, |
| 354 | + $version = false, |
| 355 | + $package_provider = 'package', |
| 356 | + $package_url = undef, |
| 357 | + $package_dir = $elasticsearch::params::package_dir, |
| 358 | + $package_name = $elasticsearch::params::package, |
| 359 | + $package_pin = true, |
| 360 | + $purge_package_dir = $elasticsearch::params::purge_package_dir, |
| 361 | + $package_dl_timeout = $elasticsearch::params::package_dl_timeout, |
| 362 | + $proxy_url = undef, |
| 363 | + $elasticsearch_user = $elasticsearch::params::elasticsearch_user, |
| 364 | + $elasticsearch_group = $elasticsearch::params::elasticsearch_group, |
| 365 | + $configdir = $elasticsearch::params::configdir, |
| 366 | + $purge_configdir = $elasticsearch::params::purge_configdir, |
| 367 | + $service_provider = 'init', |
| 368 | + $init_defaults = undef, |
| 369 | + $init_defaults_file = undef, |
| 370 | + $init_template = "${module_name}/etc/init.d/${elasticsearch::params::init_template}", |
| 371 | + $config = undef, |
| 372 | + $config_hiera_merge = false, |
| 373 | + $datadir = $elasticsearch::params::datadir, |
| 374 | + $logdir = $elasticsearch::params::logdir, |
| 375 | + $plugindir = $elasticsearch::params::plugindir, |
| 376 | + $java_install = false, |
| 377 | + $java_package = undef, |
| 378 | + $manage_repo = false, |
| 379 | + $repo_version = undef, |
| 380 | + $repo_priority = undef, |
| 381 | + $repo_key_id = '46095ACC8548582C1A2699A9D27D666CD88E42B4', |
| 382 | + $repo_key_source = 'http://packages.elastic.co/GPG-KEY-elasticsearch', |
| 383 | + $repo_proxy = undef, |
| 384 | + $logging_file = undef, |
| 385 | + $logging_config = undef, |
| 386 | + $logging_template = undef, |
| 387 | + $default_logging_level = $elasticsearch::params::default_logging_level, |
| 388 | + $repo_stage = false, |
| 389 | + $instances = undef, |
| 390 | + $instances_hiera_merge = false, |
| 391 | + $plugins = undef, |
| 392 | + $plugins_hiera_merge = false, |
| 393 | + $use_ssl = undef, |
| 394 | + $validate_ssl = undef, |
| 395 | + $ssl_user = undef, |
| 396 | + $ssl_password = undef, |
| 397 | + $api_protocol = 'http', |
| 398 | + $api_host = 'localhost', |
| 399 | + $api_port = 9200, |
| 400 | + $api_timeout = 10, |
| 401 | + $api_basic_auth_username = undef, |
| 402 | + $api_basic_auth_password = undef, |
| 403 | + $api_ca_file = undef, |
| 404 | + $api_ca_path = undef, |
| 405 | + $validate_tls = true, |
| 406 | + $system_key = undef, |
| 407 | + $file_rolling_type = $elasticsearch::params::file_rolling_type, |
| 408 | + $daily_rolling_date_pattern = $elasticsearch::params::daily_rolling_date_pattern, |
| 409 | + $rolling_file_max_backup_index = $elasticsearch::params::rolling_file_max_backup_index, |
| 410 | + $rolling_file_max_file_size = $elasticsearch::params::rolling_file_max_file_size, |
386 | 411 | ) inherits elasticsearch::params {
|
387 | 412 |
|
388 | 413 | anchor {'elasticsearch::begin': }
|
|
403 | 428 | fail("\"${status}\" is not a valid status parameter value")
|
404 | 429 | }
|
405 | 430 |
|
| 431 | + if ! ($file_rolling_type in [ 'dailyRollingFile', 'rollingFile']) { |
| 432 | + file("\"${file_rolling_type}\" is not a valid type") |
| 433 | + } |
| 434 | + |
| 435 | + validate_integer($rolling_file_max_backup_index) |
| 436 | + validate_string($daily_rolling_date_pattern) |
| 437 | + validate_string($rolling_file_max_file_size) |
| 438 | + |
| 439 | + |
406 | 440 | # restart on change
|
407 | 441 | validate_bool(
|
408 | 442 | $restart_on_change,
|
|
0 commit comments