From 9df5ad5f7b4aaaa2348969d3b5afd827807f36c2 Mon Sep 17 00:00:00 2001 From: Brian Schonecker Date: Wed, 4 Dec 2024 07:27:47 -0500 Subject: [PATCH] Allow overriding of the Include directive in the /etc/rsyslog.conf file to support older versions of rsyslogd. --- manifests/base.pp | 2 +- manifests/init.pp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/base.pp b/manifests/base.pp index 217fb26f..d95f9254 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -58,7 +58,7 @@ file { $rsyslog::config_file: ensure => file, - content => "${message}\ninclude(file=\"${rsyslog::confdir}/*.conf\" mode=\"optional\")\n", + content => "${message}\n${rsyslog::config_file_include}\n", mode => $rsyslog::global_conf_perms, } diff --git a/manifests/init.pp b/manifests/init.pp index cef1ccc4..867a4974 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -85,6 +85,8 @@ # Set the file mode for the rsyslog.d configuration directory. # @param global_conf_perms # Set the file mode for the /etc/rsyslog.conf +# @param config_file_include +# Override the include directive in the /etc/rsyslog.conf file. # class rsyslog ( String $confdir, @@ -118,6 +120,7 @@ Stdlib::Filemode $conf_permissions = '0644', Stdlib::Filemode $confdir_permissions = '0755', Stdlib::Filemode $global_conf_perms = $conf_permissions, + String $config_file_include = "include(file=\"${rsyslog::confdir}/*.conf\" mode=\"optional\")", ) { if $manage_service == true and $external_service == true { fail('manage_service and external_service cannot be set at the same time!')