add puppet 4 support, fixes #155
This commit is contained in:
Родитель
c4f29754e4
Коммит
a54788233d
|
@ -22,6 +22,7 @@ env:
|
|||
- PUPPET_GEM_VERSION="~> 3.3.0"
|
||||
- PUPPET_GEM_VERSION="~> 3.4.0"
|
||||
- PUPPET_GEM_VERSION="~> 3.5.0"
|
||||
- PUPPET_GEM_VERSION="~> 4.1.0"
|
||||
global:
|
||||
- PUBLISHER_LOGIN=saz
|
||||
- secure: |-
|
||||
|
|
|
@ -42,6 +42,7 @@ define rsyslog::imfile(
|
|||
# This mode should defined when having multiline messages.
|
||||
$imfile_readmode = $file_readmode ? {
|
||||
/^$/ => undef, # Do not specify in configuration (current default behaviour)
|
||||
undef => undef, # Do not specify in configuration (current default behaviour)
|
||||
/^(0|default|line)$/ => 0, # Each line is a new message.
|
||||
/^(1|paragraph)$/ => 1, # There is a blank line between log messages.
|
||||
/^(2|indented)$/ => 2, # New log messages start at the beginning of a line. If a line starts with a space it is part of the log message before it.
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
# 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
|
||||
$ActionQueueMaxDiskSpace <%= @spool_size -%> # spool space limit (use as much as possible)
|
||||
$ActionQueueMaxDiskSpace <%= scope.lookupvar('rsyslog::client::spool_size') -%> # spool space limit (use as much as possible)
|
||||
$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
|
||||
<% if @spool_timeoutenqueue -%>
|
||||
$ActionQueueTimeoutEnqueue <%= @spool_timeoutenqueue -%> # time to wait before discarding on full spool
|
||||
<% 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 @log_templates and ! @log_templates.empty?-%>
|
||||
<% if scope.lookupvar('rsyslog::client::log_templates') and ! scope.lookupvar('rsyslog::client::log_templates').empty?-%>
|
||||
|
||||
# Define custom logging templates
|
||||
<% @log_templates.flatten.compact.each do |log_template| -%>
|
||||
<% scope.lookupvar('rsyslog::client::log_templates').flatten.compact.each do |log_template| -%>
|
||||
$template <%= log_template['name'] %>,"<%= log_template['template'] %>"
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
<% if @actionfiletemplate -%>
|
||||
<% if scope.lookupvar('rsyslog::client::actionfiletemplate') -%>
|
||||
|
||||
# Using specified format for default logging format:
|
||||
$ActionFileDefaultTemplate <%= @actionfiletemplate %>
|
||||
$ActionFileDefaultTemplate <%= scope.lookupvar('rsyslog::client::actionfiletemplate') %>
|
||||
<% else -%>
|
||||
|
||||
<% if @high_precision_timestamps == false -%>
|
||||
<% if scope.lookupvar('rsyslog::client::high_precision_timestamps') == false -%>
|
||||
# Use default format
|
||||
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
|
||||
<% else -%>
|
||||
|
@ -30,35 +30,35 @@ $ActionFileDefaultTemplate RSYSLOG_FileFormat
|
|||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
<% if @rate_limit_burst -%>
|
||||
$SystemLogRateLimitBurst <%= @rate_limit_burst %>
|
||||
<% if scope.lookupvar('rsyslog::client::rate_limit_burst') -%>
|
||||
$SystemLogRateLimitBurst <%= scope.lookupvar('rsyslog::client::rate_limit_burst') %>
|
||||
<% end -%>
|
||||
<% if @rate_limit_interval -%>
|
||||
$SystemLogRateLimitInterval <%= @rate_limit_interval %>
|
||||
<% if scope.lookupvar('rsyslog::client::rate_limit_interval') -%>
|
||||
$SystemLogRateLimitInterval <%= scope.lookupvar('rsyslog::client::rate_limit_interval') %>
|
||||
<% end -%>
|
||||
|
||||
<% if @listen_localhost -%>
|
||||
<% if scope.lookupvar('rsyslog::client::listen_localhost') -%>
|
||||
# Provides UDP syslog reception
|
||||
$ModLoad imudp
|
||||
$UDPServerAddress 127.0.0.1
|
||||
$UDPServerRun 514
|
||||
<% end %>
|
||||
|
||||
<% if @ssl -%>
|
||||
<% if scope.lookupvar('rsyslog::ssl') -%>
|
||||
# Setup SSL connection.
|
||||
# CA/Cert
|
||||
$DefaultNetStreamDriverCAFile <%= @ssl_ca %>
|
||||
$DefaultNetStreamDriverCAFile <%= scope.lookupvar('rsyslog::client::ssl_ca') %>
|
||||
|
||||
# Connection settings.
|
||||
$DefaultNetstreamDriver gtls
|
||||
$ActionSendStreamDriverMode 1
|
||||
$ActionSendStreamDriverAuthMode <%= @ssl_auth_mode %>
|
||||
$ActionSendStreamDriverAuthMode <%= scope.lookupvar('rsyslog::client::ssl_auth_mode') %>
|
||||
<% if @ssl_permitted_peer -%>
|
||||
$ActionSendStreamDriverPermittedPeer <%= @ssl_permitted_peer %>
|
||||
$ActionSendStreamDriverPermittedPeer <%= scope.lookupvar('rsyslog::client::ssl_permitted_peer') %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
<% if @remote_type == 'relp' -%>
|
||||
<% if scope.lookupvar('rsyslog::client::remote_type') == 'relp' -%>
|
||||
# Load RELP module.
|
||||
$ModLoad omrelp
|
||||
<% end -%>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<% if @log_auth_local or @log_local -%>
|
||||
<% if scope.lookupvar('rsyslog::client::log_auth_local') or scope.lookupvar('rsyslog::client::log_local') -%>
|
||||
# Logging locally.
|
||||
|
||||
<% if scope.lookupvar('rsyslog::log_style') == 'debian' -%>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% if @remote_servers -%>
|
||||
<% @remote_servers.flatten.compact.each do |server| -%>
|
||||
<% 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'] -%>
|
||||
<% else -%>
|
||||
|
@ -47,16 +47,16 @@
|
|||
<%= pattern %> <%= protocol %><%= host %>:<%= port %><%= format %>
|
||||
<%= dropaction %>
|
||||
<% end -%>
|
||||
<% elsif @log_remote -%>
|
||||
<% elsif scope.lookupvar('rsyslog::client::log_remote') -%>
|
||||
|
||||
# Log to remote syslog server using <%= @remote_type %>
|
||||
<% if @remote_type == 'tcp' -%>
|
||||
*.* @@<%= @server -%>:<%= @port -%>;<%= @remote_forward_format -%>
|
||||
# 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') -%>;<%= scope.lookupvar('rsyslog::client::remote_forward_format') -%>
|
||||
<% else -%>
|
||||
<% if @remote_type == 'relp' -%>
|
||||
*.* :omrelp:<%= @server -%>:<%= @port -%>;<%= @remote_forward_format -%>
|
||||
<% if scope.lookupvar('rsyslog::client::remote_type') == 'relp' -%>
|
||||
*.* :omrelp:<%= scope.lookupvar('rsyslog::client::server') -%>:<%= scope.lookupvar('rsyslog::client::port') -%>;<%= scope.lookupvar('rsyslog::client::remote_forward_format') -%>
|
||||
<% else -%>
|
||||
*.* @<%= @server -%>:<%= @port -%>;<%= @remote_forward_format -%>
|
||||
*.* @<%= scope.lookupvar('rsyslog::client::server') -%>:<%= scope.lookupvar('rsyslog::client::port') -%>;<%= scope.lookupvar('rsyslog::client::remote_forward_format') -%>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<% @extra_modules.each do |mod| -%>
|
||||
<% scope.lookupvar('rsyslog::extra_modules').each do |mod| -%>
|
||||
$ModLoad <%= mod %>
|
||||
<% end -%>
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
# file is managed by puppet
|
||||
<% if @preserve_fqdn -%>
|
||||
<% if scope.lookupvar('rsyslog::preserve_fqdn') -%>
|
||||
$PreserveFQDN on
|
||||
<% end -%>
|
||||
#################
|
||||
#### MODULES ####
|
||||
#################
|
||||
|
||||
<% @modules.each do |module_row| -%>
|
||||
<% scope.lookupvar('rsyslog::modules').each do |module_row| -%>
|
||||
<%= module_row %>
|
||||
<% end -%>
|
||||
|
||||
<% if @non_kernel_facility -%>
|
||||
<% if scope.lookupvar('rsyslog::non_kernel_facility') -%>
|
||||
# Enable non-kernel facility klog messages
|
||||
$KLogPermitNonKernelFacility on
|
||||
|
||||
|
@ -21,17 +21,17 @@ $KLogPermitNonKernelFacility on
|
|||
#
|
||||
# Set max message size for sending and receiving
|
||||
#
|
||||
$MaxMessageSize <%= @max_message_size %>
|
||||
$MaxMessageSize <%= scope.lookupvar('rsyslog::max_message_size') %>
|
||||
|
||||
<% if @default_template -%>
|
||||
<% if scope.lookupvar('rsyslog::default_template') -%>
|
||||
#
|
||||
# Use traditional timestamp format.
|
||||
# To enable high precision timestamps, comment out the following line.
|
||||
#
|
||||
$ActionFileDefaultTemplate <%= @default_template %>
|
||||
$ActionFileDefaultTemplate <%= scope.lookupvar('rsyslog::default_template') %>
|
||||
|
||||
<% end -%>
|
||||
<% if @msg_reduction -%>
|
||||
<% if scope.lookupvar('rsyslog::msg_reduction') -%>
|
||||
# Filter duplicated messages
|
||||
$RepeatedMsgReduction on
|
||||
|
||||
|
@ -39,29 +39,29 @@ $RepeatedMsgReduction on
|
|||
#
|
||||
# Set the default permissions for all log files.
|
||||
#
|
||||
$FileOwner <%= @log_user %>
|
||||
$FileGroup <%= @log_group %>
|
||||
$FileCreateMode <%= @perm_file %>
|
||||
$DirOwner <%= @log_user %>
|
||||
$DirGroup <%= @log_group %>
|
||||
$DirCreateMode <%= @perm_dir %>
|
||||
$PrivDropToUser <%= @run_user %>
|
||||
$PrivDropToGroup <%= @run_group %>
|
||||
$WorkDirectory <%= @spool_dir %>
|
||||
<% if @umask -%>
|
||||
$Umask <%= @umask %>
|
||||
$FileOwner <%= scope.lookupvar('rsyslog::log_user') %>
|
||||
$FileGroup <%= scope.lookupvar('rsyslog::log_group') %>
|
||||
$FileCreateMode <%= scope.lookupvar('rsyslog::perm_file') %>
|
||||
$DirOwner <%= scope.lookupvar('rsyslog::log_user') %>
|
||||
$DirGroup <%= scope.lookupvar('rsyslog::log_group') %>
|
||||
$DirCreateMode <%= scope.lookupvar('rsyslog::perm_dir') %>
|
||||
$PrivDropToUser <%= scope.lookupvar('rsyslog::run_user') %>
|
||||
$PrivDropToGroup <%= scope.lookupvar('rsyslog::run_group') %>
|
||||
$WorkDirectory <%= scope.lookupvar('rsyslog::spool_dir') %>
|
||||
<% if scope.lookupvar('rsyslog::umask') -%>
|
||||
$Umask <%= scope.lookupvar('rsyslog::umask') %>
|
||||
<% end -%>
|
||||
|
||||
<% if @omit_local_logging -%>
|
||||
<% if scope.lookupvar('rsyslog::omit_local_logging') -%>
|
||||
# Turn off message reception via local log socket;
|
||||
# local messages are retrieved through imjournal now.
|
||||
$OmitLocalLogging on
|
||||
<% end -%>
|
||||
|
||||
#
|
||||
# Include all config files in <%= @rsyslog_d %>
|
||||
# Include all config files in <%= scope.lookupvar('rsyslog::rsyslog_d') %>
|
||||
#
|
||||
$IncludeConfig <%= @rsyslog_d -%>*.conf
|
||||
$IncludeConfig <%= scope.lookupvar('rsyslog::rsyslog_d') -%>*.conf
|
||||
|
||||
#
|
||||
# Emergencies are sent to everybody logged in.
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
# Log files are stored in directories matching the short hostname, excluding numbers
|
||||
# i.e. web01 web02 and web03 will all log to a the web directory
|
||||
<% if @enable_onefile == false -%>
|
||||
<% if scope.lookupvar('rsyslog::server::enable_onefile') == false -%>
|
||||
|
||||
# Templates
|
||||
$Template dynAuditLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%source:R,ERE,1,DFLT:([A-Za-z-]*)--end%<%= scope.lookupvar('rsyslog::server::logpath') -%>audit.log"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<%= scope.function_template(['rsyslog/server/_default-header.conf.erb']) %>
|
||||
|
||||
# Log files are stored in directories matching the hostname
|
||||
<% if @enable_onefile == false -%>
|
||||
<% if scope.lookupvar('rsyslog::server::enable_onefile') == false -%>
|
||||
|
||||
# Templates
|
||||
$Template dynAuthLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>auth.log"
|
||||
|
|
|
@ -2,20 +2,20 @@
|
|||
# Switch back to default ruleset
|
||||
$RuleSet RSYSLOG_DefaultRuleset
|
||||
|
||||
<% if @enable_udp -%>
|
||||
<% if scope.lookupvar('rsyslog::server::enable_udp') -%>
|
||||
$InputUDPServerBindRuleset remote
|
||||
$UDPServerRun <%= @port %>
|
||||
$UDPServerAddress <%= @address %>
|
||||
$UDPServerRun <%= scope.lookupvar('rsyslog::server::port') %>
|
||||
$UDPServerAddress <%= scope.lookupvar('rsyslog::server::address') %>
|
||||
<% end -%>
|
||||
|
||||
<% if @enable_tcp -%>
|
||||
<% if scope.lookupvar('rsyslog::server::enable_tcp') -%>
|
||||
$InputTCPServerBindRuleset remote
|
||||
$InputTCPServerRun <%= @port %>
|
||||
$InputTCPServerRun <%= scope.lookupvar('rsyslog::server::port') %>
|
||||
<% end -%>
|
||||
|
||||
<% if @enable_relp -%>
|
||||
<% if scope.lookupvar('rsyslog::server::enable_relp') -%>
|
||||
<% if (scope.function_versioncmp([@rsyslog_version, '6.3.6']) >= 0) -%>
|
||||
$InputRELPServerBindRuleset remote
|
||||
$InputRELPServerRun <%= @relp_port %>
|
||||
$InputRELPServerRun <%= scope.lookupvar('rsyslog::server::relp_port') %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
<% if @enable_udp -%>
|
||||
<% if scope.lookupvar('rsyslog::server::enable_udp') -%>
|
||||
# Load UDP module
|
||||
$ModLoad imudp
|
||||
<% end -%>
|
||||
|
||||
<% if @enable_tcp -%>
|
||||
<% if scope.lookupvar('rsyslog::server::enable_tcp') -%>
|
||||
# Load TCP module
|
||||
$ModLoad imtcp
|
||||
<% end -%>
|
||||
|
||||
<% if @enable_relp -%>
|
||||
<% if scope.lookupvar('rsyslog::server::enable_relp') -%>
|
||||
<% if (scope.function_versioncmp([@rsyslog_version, '6.3.6']) >= 0) -%>
|
||||
# Load RELP module
|
||||
$ModLoad imrelp
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
<% if @log_templates and ! @log_templates.empty?-%>
|
||||
<% if scope.lookupvar('rsyslog::server::log_templates') and ! scope.lookupvar('rsyslog::server::log_templates').empty?-%>
|
||||
|
||||
# Define custom logging templates
|
||||
<% @log_templates.flatten.compact.each do |log_template| -%>
|
||||
<% scope.lookupvar('rsyslog::server::log_templates').flatten.compact.each do |log_template| -%>
|
||||
$template <%= log_template['name'] %>,"<%= log_template['template'] %>"
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
<% if @actionfiletemplate -%>
|
||||
<% if scope.lookupvar('rsyslog::server::actionfiletemplate') -%>
|
||||
|
||||
# Using specified format for default logging format:
|
||||
$ActionFileDefaultTemplate <%= @actionfiletemplate %>
|
||||
$ActionFileDefaultTemplate <%= scope.lookupvar('rsyslog::server::actionfiletemplate') %>
|
||||
<% else -%>
|
||||
|
||||
<% if @high_precision_timestamps == false -%>
|
||||
<% if scope.lookupvar('rsyslog::server::high_precision_timestamps') == false -%>
|
||||
#
|
||||
# Use traditional timestamp format.
|
||||
#
|
||||
|
@ -41,14 +41,14 @@ $ActionFileDefaultTemplate RSYSLOG_FileFormat
|
|||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
<% if @ssl -%>
|
||||
<% if scope.lookupvar('rsyslog::ssl') -%>
|
||||
# Server side SSL.
|
||||
$DefaultNetstreamDriver gtls
|
||||
|
||||
# Cert files.
|
||||
$DefaultNetstreamDriverCAFile <%= @ssl_ca %>
|
||||
$DefaultNetstreamDriverCertFile <%= @ssl_cert %>
|
||||
$DefaultNetstreamDriverKeyFile <%= @ssl_key %>
|
||||
$DefaultNetstreamDriverCAFile <%= scope.lookupvar('rsyslog::server::ssl_ca') %>
|
||||
$DefaultNetstreamDriverCertFile <%= scope.lookupvar('rsyslog::server::ssl_cert') %>
|
||||
$DefaultNetstreamDriverKeyFile <%= scope.lookupvar('rsyslog::server::ssl_key') %>
|
||||
|
||||
$InputTCPServerStreamDriverMode 1
|
||||
$InputTCPServerStreamDriverAuthMode anon
|
||||
|
|
Загрузка…
Ссылка в новой задаче