Merge "Logging: Replace hiera by lookup"

This commit is contained in:
Zuul 2022-05-04 01:54:38 +00:00 committed by Gerrit Code Review
commit fa8623ba98
3 changed files with 33 additions and 33 deletions

View File

@ -19,94 +19,94 @@
#
# === Parameters
#
# [*step*]
# (Optional) String. The current step of the deployment
# Defaults to hiera('step')
# [*step*]
# (Optional) String. The current step of the deployment
# Defaults to Integer(lookup('step'))
#
# [*ensure*]
# (optional) Defaults to present.
# Valid values are present, absent.
# (Optional) Status of the cron job. Valid values are present, absent.
# Defaults to present.
#
# [*minute*]
# (optional) Defaults to '0'. Configures cron job for logrotate.
# (Optional) Defaults to '0'. Configures cron job for logrotate.
#
# [*hour*]
# (optional) Defaults to '*'. Configures cron job for logrotate.
# (Optional) Defaults to '*'. Configures cron job for logrotate.
#
# [*monthday*]
# (optional) Defaults to '*'. Configures cron job for logrotate.
# (Optional) Defaults to '*'. Configures cron job for logrotate.
#
# [*month*]
# (optional) Defaults to '*'. Configures cron job for logrotate.
# (Optional) Defaults to '*'. Configures cron job for logrotate.
#
# [*weekday*]
# (optional) Defaults to '*'. Configures cron job for logrotate.
# (Optional) Defaults to '*'. Configures cron job for logrotate.
#
# [*maxdelay*]
# (optional) Seconds. Defaults to 90. Should be a positive integer.
# (Optional) Seconds. Defaults to 90. Should be a positive integer.
# Induces a random delay before running the cronjob to avoid running all
# cron jobs at the same time on all hosts this job is configured.
#
# [*user*]
# (optional) Defaults to 'root'. Configures cron job for logrotate.
# (Optional) Defaults to 'root'. Configures cron job for logrotate.
#
# [*copytruncate*]
# (optional) Defaults to True.
# (Optional) Defaults to True.
# Configures the logrotate copytruncate parameter.
#
# [*delaycompress*]
# (optional) Defaults to True.
# (Optional) Defaults to True.
# Configures the logrotate delaycompress parameter.
#
# [*compress*]
# (optional) Defaults to True.
# (Optional) Defaults to True.
# Configures the logrotate compress parameter.
#
# [*minsize*]
# (optional) Defaults to '1'.
# (Optional) Defaults to '1'.
# Configures the logrotate minsize parameter.
#
# [*maxsize*]
# (optional) Defaults to '10M'.
# (Optional) Defaults to '10M'.
# Configures the logrotate maxsize parameter.
#
# [*notifempty*]
# (optional) Defaults to True.
# (Optional) Defaults to True.
# Configures the logrotate notifempty parameter.
#
# [*rotation*]
# (optional) Defaults to 'daily'.
# (Optional) Defaults to 'daily'.
# Configures the logrotate rotation interval.
#
# [*rotate*]
# (optional) Defaults to 14.
# (Optional) Defaults to 14.
# Configures the logrotate rotate parameter.
#
# [*purge_after_days*]
# (optional) Defaults to 14.
# (Optional) Defaults to 14.
# Configures forced purge period for rotated logs.
# Overrides the rotation and rotate settings.
#
# [*dateext*]
# (optional) Defaults to undef.
# (Optional) Defaults to undef.
# Configures the dateext parameter.
#
# [*dateformat*]
# (optional) Defaults to undef.
# (Optional) Defaults to undef.
# Configures the dateformat parameter used with dateext parameter.
#
# [*dateyesterday*]
# (optional) Defaults to undef.
# (Optional) Defaults to undef.
# Configures the dateyesterday parameter used with dateext parameter.
#
# DEPRECATED PARAMETERS
#
# [*size*]
# DEPRECATED: (optional) Defaults to '10M'.
# DEPRECATED: (Optional) Defaults to '10M'.
# Configures the logrotate size parameter.
#
class tripleo::profile::base::logging::logrotate (
$step = Integer(hiera('step')),
$step = Integer(lookup('step')),
$ensure = present,
$minute = 0,
$hour = '*',

View File

@ -20,12 +20,12 @@
#
# [*step*]
# (Optional) String. The current step of the deployment
# Defaults to hiera('step')
# Defaults to Integer(lookup('step'))
#
# [*service_names*]
# (Optional) List of services enabled on the current role. This is used
# to obtain per-service configuration information.
# Defaults to hiera('service_names', [])
# Defaults to lookup('service_names', undef, undef, [])
#
# [*elasticsearch*]
# (Optional) Hash. Configuration for output plugin omelasticsearch.
@ -56,8 +56,8 @@
# Defaults to undef
#
class tripleo::profile::base::logging::rsyslog (
$step = Integer(hiera('step')),
$service_names = hiera('service_names', []),
$step = Integer(lookup('step')),
$service_names = lookup('service_names', undef, undef, []),
$elasticsearch = undef,
$elasticsearch_tls_ca_cert = undef,
$elasticsearch_tls_client_cert = undef,
@ -68,7 +68,7 @@ class tripleo::profile::base::logging::rsyslog (
if $step >= 2 {
# NOTE: puppet-rsyslog does not have params manifest, so we don't have any
# other choice than using hiera currently.
$rsyslog_confdir = hiera('rsyslog::confdir', '/etc/rsyslog.d')
$rsyslog_confdir = lookup('rsyslog::confdir', undef, undef, '/etc/rsyslog.d')
if $elasticsearch != undef {
if $elasticsearch_tls_ca_cert {

View File

@ -3,7 +3,7 @@
#
# [*sources*]
# (Optional) List of hashes. Contains configuration of file inputs for given service.
# Defaults to hiera("tripleo_logging_sources_${title}", undef)
# Defaults to lookup("tripleo_logging_sources_${title}", undef, undef, undef)
#
# [*default_startmsg*]
# (Optional) String. Default POSIX ERE for start of log record. The default enables to forward
@ -18,7 +18,7 @@
# Defaults to undef
#
define tripleo::profile::base::logging::rsyslog::file_input (
$sources = hiera("tripleo_logging_sources_${title}", undef),
$sources = lookup("tripleo_logging_sources_${title}", undef, undef, undef),
$default_startmsg = '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}(.[0-9]+ [0-9]+)? (DEBUG|INFO|WARNING|ERROR) ',
Optional[Enum['on','off']] $reopen_on_truncate = undef
) {