diff --git a/manifests/client.pp b/manifests/client.pp index e045adc..aeae91b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -39,34 +39,39 @@ # class { 'rsyslog::client': } # class rsyslog::client ( - $log_remote = true, - $spool_size = '1g', - $spool_timeoutenqueue = false, - $remote_type = 'tcp', - $remote_forward_format = 'RSYSLOG_ForwardFormat', - $log_local = false, - $disable_xconsole = false, - $log_local_custom = undef, - $log_auth_local = false, - $listen_localhost = false, - $split_config = false, - $custom_config = undef, - $custom_params = undef, - $server = 'log', - $port = '514', - $remote_servers = false, - $ssl = false, - $ssl_ca = undef, - $ssl_cert = undef, - $ssl_key = undef, - $ssl_permitted_peer = undef, - $ssl_auth_mode = 'anon', - $log_templates = false, - $log_filters = false, - $actionfiletemplate_cust = false, - $actionfiletemplate = false, - $high_precision_timestamps = false, - $imfiles = undef + $log_remote = true, + $spool_size = '1g', + $spool_timeoutenqueue = false, + $remote_type = 'tcp', + $remote_forward_format = 'RSYSLOG_ForwardFormat', + $log_local = false, + $disable_xconsole = false, + $log_local_custom = undef, + $log_auth_local = false, + $listen_localhost = false, + $split_config = false, + $custom_config = undef, + $custom_params = undef, + $server = 'log', + $port = '514', + $remote_servers = false, + $ssl = false, + $ssl_ca = undef, + $ssl_cert = undef, + $ssl_key = undef, + $ssl_permitted_peer = undef, + $ssl_auth_mode = 'anon', + $log_templates = false, + $log_filters = false, + $actionfiletemplate_cust = false, + $actionfiletemplate = false, + $high_precision_timestamps = false, + $imfiles = undef, + $use_cron = true, + $action_queue_filename = 'queue', + $action_queue_save_on_shutdown = 'no', + $action_queue_type = 'LinkedList', + $action_resume_retry_count = '-1', ) inherits rsyslog::params { include ::rsyslog diff --git a/templates/client/config.conf.erb b/templates/client/config.conf.erb index f4afabe..841f61f 100644 --- a/templates/client/config.conf.erb +++ b/templates/client/config.conf.erb @@ -1,13 +1,23 @@ # An "In-Memory Queue" is created for remote logging. $WorkDirectory <%= scope.lookupvar('rsyslog::spool_dir') -%> # where to place spool files -$ActionQueueFileName queue # unique name prefix for spool files +<% if scope.lookupvar('rsyslog::client::action_queue_filename') and scope.lookupvar('rsyslog::client::action_queue_filename') != :undef -%> +$ActionQueueFileName <%= scope.lookupvar('rsyslog::client::action_queue_filename') -%> # unique name prefix for spool files +<% end -%> +<% if scope.lookupvar('rsyslog::client::spool_size') and scope.lookupvar('rsyslog::client::spool_size') != :undef -%> $ActionQueueMaxDiskSpace <%= scope.lookupvar('rsyslog::client::spool_size') -%> # spool space limit (use as much as possible) -$ActionQueueSaveOnShutdown on # save messages to disk on shutdown +<% end -%> +<% if scope.lookupvar('rsyslog::client::action_queue_save_on_shutdown') and scope.lookupvar('rsyslog::client::action_queue_save_on_shutdown') != :undef -%> +$ActionQueueSaveOnShutdown <%= scope.lookupvar('rsyslog::client::action_queue_save_on_shutdown') -%> # whether to save messages to disk on shutdown +<% end -%> <% if scope.lookupvar('rsyslog::client::spool_timeoutenqueue') -%> $ActionQueueTimeoutEnqueue <%= scope.lookupvar('rsyslog::client::spool_timeoutenqueue') -%> # time to wait before discarding on full spool <% end -%> -$ActionQueueType LinkedList # run asynchronously -$ActionResumeRetryCount -1 # infinety retries if host is down +<% if scope.lookupvar('rsyslog::client::action_queue_type') and scope.lookupvar('rsyslog::client::action_queue_type') != :undef -%> +$ActionQueueType <%= scope.lookupvar('rsyslog::client::action_queue_type') -%> # processing type +<% end -%> +<% if scope.lookupvar('rsyslog::client::action_resume_retry_count') and scope.lookupvar('rsyslog::client::action_resume_retry_count') != :undef -%> +$ActionResumeRetryCount <%= scope.lookupvar('rsyslog::client::action_resume_retry_count') -%> # retries if host is down +<% end -%> <% if scope.lookupvar('rsyslog::client::log_templates') and ! scope.lookupvar('rsyslog::client::log_templates').empty?-%> # Define custom logging templates diff --git a/templates/client/local.conf.erb b/templates/client/local.conf.erb index a7458a9..37bbcc5 100644 --- a/templates/client/local.conf.erb +++ b/templates/client/local.conf.erb @@ -17,7 +17,9 @@ auth.info;authpriv.info /var/log/auth.log # First some standard log files. Log by facility. # *.*;auth,authpriv.none -/var/log/syslog +<% if scope.lookupvar('rsyslog::client::use_cron') -%> cron.* /var/log/cron.log +<% end -%> daemon.* -/var/log/daemon.log kern.* -/var/log/kern.log #lpr.* -/var/log/lpr.log diff --git a/templates/rsyslog.conf.erb b/templates/rsyslog.conf.erb index 10333e3..5016222 100644 --- a/templates/rsyslog.conf.erb +++ b/templates/rsyslog.conf.erb @@ -24,7 +24,9 @@ $KLogPermitNonKernelFacility on # # Set max message size for sending and receiving # +<% if scope.lookupvar('rsyslog::max_message_size') -%> $MaxMessageSize <%= scope.lookupvar('rsyslog::max_message_size') %> +<% end -%> # # Set rate limit for messages received. @@ -61,13 +63,21 @@ $RepeatedMsgReduction on $FileOwner <%= scope.lookupvar('rsyslog::log_user') %> $FileGroup <%= scope.lookupvar('rsyslog::log_group') %> $FileCreateMode <%= scope.lookupvar('rsyslog::perm_file') %> +<% if scope.lookupvar('rsyslog::log_user') and scope.lookupvar('rsyslog::log_user') != :undef -%> $DirOwner <%= scope.lookupvar('rsyslog::log_user') %> +<% end -%> +<% if scope.lookupvar('rsyslog::log_group') and scope.lookupvar('rsyslog::log_group') != :undef -%> $DirGroup <%= scope.lookupvar('rsyslog::log_group') %> +<% end -%> $DirCreateMode <%= scope.lookupvar('rsyslog::perm_dir') %> +<% if scope.lookupvar('rsyslog::priv_drop_user') and scope.lookupvar('rsyslog::priv_drop_user') != :undef -%> $PrivDropToUser <%= scope.lookupvar('rsyslog::run_user') %> +<% end -%> +<% if scope.lookupvar('rsyslog::priv_drop_group') and scope.lookupvar('rsyslog::priv_drop_group') != :undef -%> $PrivDropToGroup <%= scope.lookupvar('rsyslog::run_group') %> +<% end -%> $WorkDirectory <%= scope.lookupvar('rsyslog::spool_dir') %> -<% if scope.lookupvar('rsyslog::umask') -%> +<% if scope.lookupvar('rsyslog::umask') and scope.lookupvar('rsyslog::umask') != :undef -%> $Umask <%= scope.lookupvar('rsyslog::umask') %> <% end -%>