From 4704961718c81830d78f5747044f6a687991fed1 Mon Sep 17 00:00:00 2001 From: Paul Leimer Date: Thu, 6 May 2021 16:24:00 -0400 Subject: [PATCH] Add option for enabling rsyslog reopenOnTruncate reopenOnTruncate ensures rsyslog immediately recognizes when a logrotation happens on a file. When not on, rsyslog will wait for a log file to fill to its original capacity before consuming any additional logs. Setting this here will ensure that every service configured to work with rsyslog will have this parameter. Default to off because this is an experimental feature (cherry picked from commit a76bd1a69ba72d2f412e2d8ef8602861dde3e064) Change-Id: Iba6a0da80cb75a93537a014dba8e77032101e570 --- deployment/logging/rsyslog-container-puppet.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/deployment/logging/rsyslog-container-puppet.yaml b/deployment/logging/rsyslog-container-puppet.yaml index 038dd3b51e..5c48eb5999 100644 --- a/deployment/logging/rsyslog-container-puppet.yaml +++ b/deployment/logging/rsyslog-container-puppet.yaml @@ -37,6 +37,10 @@ parameters: default: {} description: Parameters specific to the role type: json + RsyslogReopenOnTruncate: + default: false + description: Rsyslog imfile reopenOnTruncate parameter + type: boolean RsyslogElasticsearchSetting: default: {} description: Configuration for rsyslog-elasticsearch plugin @@ -73,7 +77,6 @@ conditions: - equals: [{get_param: RsyslogElasticsearchTlsCACert}, ''] - equals: [{get_param: RsyslogElasticsearchTlsClientCert}, ''] - equals: [{get_param: RsyslogElasticsearchTlsClientKey}, ''] - outputs: role_data: description: Role data for the rsyslog role. @@ -182,7 +185,6 @@ outputs: outname: region value: {get_param: KeystoneRegion} format: jsonf - tripleo::profile::base::logging::rsyslog::elasticsearch: map_merge: - {get_param: RsyslogElasticsearchSetting} @@ -190,6 +192,10 @@ outputs: searchIndex: rsyslog-node-index dynSearchIndex: "on" errorfile: '/var/log/rsyslog/omelasticsearch.log' + - if: + - {get_param: RsyslogReopenOnTruncate} + - tripleo::profile::base::logging::rsyslog::reopen_on_truncate: "on" + - {} - if: - use_tls - tripleo::profile::base::logging::rsyslog::elasticsearch_tls_ca_cert: {get_param: RsyslogElasticsearchTlsCACert}