summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--manifests/server.pp1
-rw-r--r--templates/server.conf.erb8
3 files changed, 11 insertions, 0 deletions
diff --git a/README.md b/README.md
index 077735c..c109159 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,7 @@ Manage rsyslog client and server via Puppet
class { 'rsyslog::server':
enable_tcp => true,
enable_udp => true,
+ enable_onefile => false,
server_dir => '/srv/log/',
custom_config => undef,
high_precision_timestamps => false,
@@ -59,6 +60,7 @@ The following lists all the class parameters this module accepts.
--------------------------------------------------------------
enable_tcp true,false Enable TCP listener. Defaults to true.
enable_udp true,false Enable UDP listener. Defaults to true.
+ enable_onefile true,false Only one logfile per remote host. Defaults to false.
server_dir STRING Folder where logs will be stored on the server. Defaults to '/srv/log/'
custom_config STRING Specify your own template to use for server config. Defaults to undef. Example usage: custom_config => 'rsyslog/my_config.erb'
high_precision_timestamps true,false Whether or not to use high precision timestamps.
diff --git a/manifests/server.pp b/manifests/server.pp
index f5d7e88..acdc7db 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -1,6 +1,7 @@
class rsyslog::server (
$enable_tcp = true,
$enable_udp = true,
+ $enable_onfile = false,
$server_dir = '/srv/log/',
$custom_config = undef,
$high_precision_timestamps = false
diff --git a/templates/server.conf.erb b/templates/server.conf.erb
index b317ec1..dbb1a5f 100644
--- a/templates/server.conf.erb
+++ b/templates/server.conf.erb
@@ -21,6 +21,7 @@ $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
# Switch to remote ruleset
$RuleSet remote
+<% if scope.lookupvar('rsyslog::server::enable_onefile') == false -%>
# Templates
$Template dynAuthLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%source:R,ERE,1,DFLT:([A-Za-z-]*)--end%/auth.log"
$Template dynSyslog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%source:R,ERE,1,DFLT:([A-Za-z-]*)--end%/syslog"
@@ -44,6 +45,13 @@ user.* -?dynUserLog
auth.none,authpriv.none;\
cron.none,daemon.none;\
mail.none,news.none -?dynMessages
+<% else -%>
+# Template
+$Template dynAllMessages,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%source:R,ERE,1,DFLT:([A-Za-z-]*)--end%/messages"
+
+# Rules
+*.* -?dynAllMessages
+<% end -%>
# Switch back to default ruleset
$RuleSet RSYSLOG_DefaultRuleset