diff options
author | Steffen Zieger <me@saz.sh> | 2014-03-14 14:43:42 +0100 |
---|---|---|
committer | Steffen Zieger <me@saz.sh> | 2014-03-14 14:43:42 +0100 |
commit | 2d98676439e77a137618f1fb3a7580290554cd3c (patch) | |
tree | fad5afdb8757cf63827b0193be3e6a36ba1fc5a0 /templates/client.conf.erb | |
parent | 4d51a536a444ae629743a2c25673b0db1d1d1ef9 (diff) | |
parent | 7a61281c4e2e10214483776f42daddb04993f3aa (diff) |
Merge pull request #60 from Aethylred/template_strings
Template strings and other things
Diffstat (limited to 'templates/client.conf.erb')
-rw-r--r-- | templates/client.conf.erb | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/templates/client.conf.erb b/templates/client.conf.erb index 42dbccc..3ed4f32 100644 --- a/templates/client.conf.erb +++ b/templates/client.conf.erb @@ -1,4 +1,3 @@ -# file is managed by puppet # An "In-Memory Queue" is created for remote logging. $WorkDirectory <%= scope.lookupvar('rsyslog::spool_dir') -%> # where to place spool files @@ -7,14 +6,40 @@ $ActionQueueMaxDiskSpace <%= scope.lookupvar('rsyslog::client::spool_size') -%> $ActionQueueSaveOnShutdown on # save messages to disk on shutdown $ActionQueueType LinkedList # run asynchronously $ActionResumeRetryCount -1 # infinety retries if host is down +<% if scope.lookupvar('rsyslog::client::log_templates') and ! scope.lookupvar('rsyslog::client::log_templates').empty?-%> + +# Define custom logging templates +<% scope.lookupvar('rsyslog::client::log_templates').flatten.compact.each do |log_template| -%> +$template <%= log_template['name'] %>,"<%= log_template['template'] %>" +<% end -%> +<% end -%> <% if scope.lookupvar('rsyslog::client::actionfiletemplate') -%> -# Using specified format for default logging fromat: + +# Using specified format for default logging format: $ActionFileDefaultTemplate <%= scope.lookupvar('rsyslog::client::actionfiletemplate') %> <% else -%> -#Using default format for default logging fromat: + +#Using default format for default logging format: $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat <% end -%> -<% if scope.lookupvar('rsyslog::client::remote_servers') and ! scope.lookupvar('rsyslog::client::remote_servers').empty? -%> +<% if scope.lookupvar('rsyslog::client::ssl') -%> + +# Setup SSL connection. +# CA/Cert +$DefaultNetStreamDriverCAFile <%= scope.lookupvar('rsyslog::client::ssl_ca') %> + +# Connection settings. +$DefaultNetstreamDriver gtls +$ActionSendStreamDriverMode 1 +$ActionSendStreamDriverAuthMode anon +<% end -%> +<% if scope.lookupvar('rsyslog::client::preserve_fqdn') -%> + +# Tell rsyslog to use FQDN and not short server names +$PreserveFQDN on +<% end -%> +<% if scope.lookupvar('rsyslog::client::remote_servers') -%> + <% scope.lookupvar('rsyslog::client::remote_servers').flatten.compact.each do |server| -%> <% if server['pattern'] and server['pattern'] != ''-%> <% pattern = server['pattern'] -%> @@ -49,6 +74,7 @@ $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat <%= pattern %> <%= protocol %><%= host %>:<%= port %><%= format %> <% end -%> <% elsif scope.lookupvar('rsyslog::client::log_remote') -%> + # Log to remote syslog server using <%= scope.lookupvar('rsyslog::client::remote_type') %> <% if scope.lookupvar('rsyslog::client::remote_type') == 'tcp' -%> *.* @@<%= scope.lookupvar('rsyslog::client::server') -%>:<%= scope.lookupvar('rsyslog::client::port') -%>;RSYSLOG_ForwardFormat @@ -57,16 +83,6 @@ $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat <% end -%> <% end -%> <% if scope.lookupvar('rsyslog::client::log_auth_local') or scope.lookupvar('rsyslog::client::log_local') -%> -<% if scope.lookupvar('rsyslog::client::ssl') -%> -# Setup SSL connection. -# CA/Cert -$DefaultNetStreamDriverCAFile <%= scope.lookupvar('rsyslog::client::ssl_ca') %> - -# Connection settings. -$DefaultNetstreamDriver gtls -$ActionSendStreamDriverMode 1 -$ActionSendStreamDriverAuthMode anon -<% end -%> # Logging locally. @@ -78,12 +94,6 @@ auth,authpriv.* /var/log/auth.log auth,authpriv.* /var/log/secure <% end -%> <% end -%> - -<% if scope.lookupvar('rsyslog::client::preserve_fqdn') -%> -# Tell rsyslog to use FQDN and not short server names -$PreserveFQDN on -<% end -%> - <% if scope.lookupvar('rsyslog::client::log_local') -%> <% if scope.lookupvar('rsyslog::log_style') == 'debian' -%> # First some standard log files. Log by facility. |