From a1b967fafefb1df39e9e04fae0476b14063dfff4 Mon Sep 17 00:00:00 2001
From: Takashi Kajinami <tkajinam@redhat.com>
Date: Fri, 19 Mar 2021 14:15:13 +0900
Subject: [PATCH] Add support for additional log sources for rsyslog

This change introduces the new RsyslogExtraLoggingSources parameter
which allows users to transfer additional log files using rsyslog.

Change-Id: Ic6339945690339b6fb50dbfbb21026195d6a5421
---
 deployment/logging/rsyslog-container-puppet.yaml | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/deployment/logging/rsyslog-container-puppet.yaml b/deployment/logging/rsyslog-container-puppet.yaml
index a8c254e162..267ce27b5b 100644
--- a/deployment/logging/rsyslog-container-puppet.yaml
+++ b/deployment/logging/rsyslog-container-puppet.yaml
@@ -58,6 +58,12 @@ parameters:
     default: ''
     description: Contains content of the private key corresponding to the cert RsyslogElasticsearchTlsClientCert.
     type: string
+  RsyslogExtraLoggingSource:
+    type: json
+    default: []
+    description: Additional source log file(s) loaded by the rsyslog service
+    tags:
+      - role_specific
   CloudName:
     default: overcloud.localdomain
     description: The DNS name of this cloud. E.g. ci-overcloud.tripleo.org
@@ -84,6 +90,8 @@ resources:
   ContainersCommon:
     type: ../containers-common.yaml
 
+  # Merging role-specific parameters (RoleParameters) with the default parameters.
+  # RoleParameters will have the precedence over the default parameters.
   RoleParametersValue:
     type: OS::Heat::Value
     properties:
@@ -93,10 +101,13 @@ resources:
           - map_replace:
             - ContainerRsyslogImage: ContainerRsyslogImage
               ContainerRsyslogConfigImage: ContainerRsyslogConfigImage
+              extra_logging_sources: RsyslogExtraLoggingSources
             - values: {get_param: [RoleParameters]}
           - values:
               ContainerRsyslogImage: {get_param: ContainerRsyslogImage}
               ContainerRsyslogConfigImage: {get_param: ContainerRsyslogConfigImage}
+              RsyslogExtraLoggingSource: {get_param: RsyslogExtraLoggingSource}
+
 conditions:
   use_tls:
     not:
@@ -263,6 +274,8 @@ outputs:
             - tripleo::profile::base::logging::rsyslog::elasticsearch_tls_ca_cert: {get_param: RsyslogElasticsearchTlsCACert}
               tripleo::profile::base::logging::rsyslog::elasticsearch_tls_client_cert: {get_param: RsyslogElasticsearchTlsClientCert}
               tripleo::profile::base::logging::rsyslog::elasticsearch_tls_client_key: {get_param: RsyslogElasticsearchTlsClientKey}
+      service_config_settings:
+        tripleo_logging_sources_rsyslog: {get_attr: [RoleParametersValue, value, extra_logging_sources]}
       # BEGIN DOCKER SETTINGS
       puppet_config:
         config_volume: rsyslog