Puppet Class: rsyslog::receiver

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

Overview

Parameters:

  • udp_port (Any) (defaults to: 514)
  • tcp_port (Any) (defaults to: 6514)
  • log_retention_days (Any) (defaults to: 90)
  • log_directory (Any) (defaults to: '/srv/syslog')
  • archive_directory (Any) (defaults to: '/srv/syslog/archive')


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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'modules/rsyslog/manifests/receiver.pp', line 24

class rsyslog::receiver (
    $udp_port           = 514,
    $tcp_port           = 6514,
    $log_retention_days = 90,
    $log_directory      = '/srv/syslog',
    $archive_directory  = '/srv/syslog/archive',
) {
    require_package('rsyslog-gnutls')

    if ($log_directory == $archive_directory) {
        fail("rsyslog log and archive are the same: ${log_directory}")
    }

    # SSL configuration
    ::base::expose_puppet_certs { '/etc/rsyslog-receiver':
        provide_private => true,
    }

    systemd::unit { 'rsyslog':
        ensure   => present,
        override => true,
        content  => template('rsyslog/initscripts/rsyslog_receiver.systemd_override.erb'),
    }

    file { '/etc/rsyslog-receiver':
        ensure => directory,
        owner  => 'root',
        group  => 'root',
        mode   => '0500',
    }

    rsyslog::conf { 'receiver':
        content  => template("${module_name}/receiver.erb.conf"),
        priority => 10,
    }

    logrotate::conf { 'rsyslog_receiver':
        ensure  => present,
        content => template("${module_name}/receiver_logrotate.erb.conf"),
    }

    # disable DNS lookup for remote messages
    file { '/etc/default/rsyslog':
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => 'RSYSLOGD_OPTIONS="-x"',
        notify  => Service['rsyslog'],
    }

    file { $log_directory:
        ensure => directory,
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
    }

    file { $archive_directory:
        ensure => directory,
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
    }

    rsync::quickdatacopy { 'centrallog':
        ensure              => absent,
        source_host         => 'centrallog1001.eqiad.wmnet',
        dest_host           => 'centrallog2001.codfw.wmnet',
        auto_sync           => false,
        module_path         => '/srv/syslog',
        server_uses_stunnel => true,
    }
}