Puppet Class: rsyslog

Defined in:
modules/rsyslog/manifests/init.pp

Overview

SPDX-License-Identifier: Apache-2.0

Class: rsyslog

rsyslogd is a full-featured kernel logging daemon. It is the default syslogd implementation on Debian systems.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'modules/rsyslog/manifests/init.pp', line 7

class rsyslog {
    ensure_packages('rsyslog')

    file { '/etc/rsyslog.d':
        ensure  => directory,
        source  => 'puppet:///modules/rsyslog/rsyslog.d-empty',
        owner   => 'root',
        group   => 'root',
        mode    => '0755',
        recurse => true,
        purge   => true,
        force   => true,
        ignore  => '50-default.conf',
        require => Package['rsyslog'],
        notify  => Service['rsyslog'],
    }

    service { 'rsyslog':
        ensure  => running,
        require => Package['rsyslog'],
    }

    file { '/etc/rsyslog.d/00-abort-unclean-config.conf':
        ensure => absent,
        notify => Service['rsyslog'],
    }

    profile::auto_restarts::service { 'rsyslog': }

    $rsyslog_global_conf = '/etc/rsyslog.d/00-global.conf'
    concat { $rsyslog_global_conf:
        ensure => 'present',
        owner  => 'root',
        group  => 'root',
        mode   => '0444',
        order  => 'alpha',
        notify => Service['rsyslog'],
    }
    concat::fragment { "${rsyslog_global_conf}-header":
        target  => $rsyslog_global_conf,
        order   => '000',
        content => "global(\n",
    }
    concat::fragment { "${rsyslog_global_conf}-trailer":
        target  => $rsyslog_global_conf,
        order   => 'zzz',
        content => ")\n",
    }

    # Include slashes in program names, as used in programs like
    # 'postfix/smtpd', rather than stopping at the slash.
    rsyslog::global_entry('parser.permitSlashInProgramName', 'on')
}