===
Module to manage rsyslog. Handles both local and remote logging.
Inspired by saz/rsyslog
This module will ensure that sysklogd is absent, which is needed on EL5.
===
This module has been tested to work on the following systems with the
latest Puppet v3, v3 with future parser, v4, v5 and v6. See .travis.yml
for the exact matrix of supported Puppet and ruby versions.
[*] This module support the basic
configuration format for rsyslog.
EL 8 by default utilize the advanced
configuration format but is compatible with basic
configurations as well.
===
Add the following entries to Hiera.
You will likely have a specific host/port for your account.
rsyslog::use_tls: true rsyslog::permitted_peer: '*.papertrailapp.com' rsyslog::log_server: 'logs2.papertrailapp.com' rsyslog::log_server_port: '1234' rsyslog::ca_file: '/etc/papertrail-bundle.pem'
rsyslog::is_log_server: true
rsyslog::package: - 'rsyslog7' - 'rsyslog7-gnutls'
===
Name of the rsyslog package. If use_tls is true, the default is the array ['rsyslog','rsyslog-gnutls']
.
What state the package should be in. Valid values are 'present', 'absent', 'purged', 'held' and 'latest'.
Change package provider.
Path to pid file.
Array of log entry lines for the rules section. One entry per line. It would be wise to keep it in sync with $logrotate_syslog_files option. 'USE_DEFAULTS' provides the module previous defaults values.
Enable logrotate.
Path of the logrotate config file.
Owner of the logrotate config file.
Group of the logrotate config file.
Mode of the logrotate config file.
Array of options to be used for log rotation. 'USE_DEFAULTS' will choose the options based on the osfamily.
Array of files which should be log rotated by /etc/logrotate.d/syslog ($logrotate_d_config_path). 'USE_DEFAULTS' will choose the files based on the osfamily.
Path of the rsyslog config file.
Owner of the rsyslog config file.
Group of the rsyslog config file.
Mode of the rsyslog config file.
Path of the rsyslog sysconfig config file.
Owner of the rsyslog sysconfig config file.
Group of the rsyslog sysconfig config file.
Mode of the rsyslog sysconfig config file.
String with startup options to pass to rsyslog.
Name of the rsyslog service. 'USE_DEFAULTS' will choose the service name based on the osfamily. 'rsyslog' # RHEL, Debian 'syslog' # Suse
Whether a service should be running. Valid values are 'stopped' and 'running'.
Whether a service should be enabled to start at boot. Valid values are true, false, 'manual'.
Boolean to determine if the system syslog service is meant to receive messages from remote hosts.
Path to store logs, if $is_log_server is true.
Owner of the log directory.
Group of the log directory.
Mode of the log directory.
Template path to store logs from remote hosts, appended after log_dir
Boolean to determine whether to send logs remotely to a centralized logging service.
Format version of rsyslog.conf file format. Supported are version 2 (clients only), 3, 4 and 5. 'USE_DEFAULTS' will choose the version based on the installed package version.
Path to place rsyslog.d files.
Owner of the rsyslog.d directory.
Group of the rsyslog.d directory.
Mode of the rsyslog.d directory.
Boolean to purge unmanaged files from rsyslog.d
Hash of fragments to pass to rsyslog::fragment
Path to place spool files.
Owner of the spool directory.
Group of the spool directory.
Mode of the spool directory.
Maximum disk space used by spool files. Uses one letter units such as k, m and g.
Transport protocol used by rsyslog. Valid values are 'tcp' and 'udp'
String or array of server to send logs to if remote_logging is true. May include an optional port number if you wish to override the log_server_port value for an entry.
Example:
rsyslog::log_server: 'log'
OR
rsyslog::log_server: - 'log1' - 'log2:1514' - 'log3:2514'
Default port of the server to send logs to if remote_logging is true. Will not be used if a log_server entry contains a port number.
Whether to enable tcp listening for the service. If undefined, set by $transport_protocol.
Whether to enable udp listening for the service. If undefined, set by $transport_protocol.
Target of kernel logs.
Target of emergency messages as string. 'USE_DEFAULTS' decides depending on actually running rsyslog version.
List of source facilities to be sent to remote log server. Only used if remote_logging is true.
*.*
Boolean to include directives related to using TLS.
Path to .pem for use with TLS. Required if use_tls is true.
Permitted peer for TLS. Value of $ActionSendStreamDriverPermittedPeer
setting in rsyslog.conf. Required if use_tls is true.
The rsyslogd processes' umask. If not specified, the system-provided default is used. The value given must always be a 4-digit octal number, with the initial digit being zero.
The creation mode with which rsyslogd creates new files. The value given must always be a 4-digit octal number, with the initial digit being zero.
The creation mode with which rsyslogd creates new directories.
The default location for work (spool) files.
The journal state file used by rsyslog.
Boolean for using the imjournal module. If set to 'USE_DEFAULTS', this will be chosen based on the platform.
Boolean for managing /dev/log. If set to 'USE_DEFAULTS', this will be chosen based on the platform.
===
Places a fragment in $rsyslog_d_dir directory
Whether the file should exist or not. Possible values are file and absent.
String with contents of the fragment file.
rsyslog::rsyslog_fragments: everything: content: "*.* /tmp/everything"