Puppet Class: profile::rsyslog::kafka_shipper

Defined in:
modules/profile/manifests/rsyslog/kafka_shipper.pp

Overview

Parameters:

  • logging_kafka_brokers (Array) (defaults to: lookup('profile::rsyslog::kafka_shipper::kafka_brokers', {'default_value' => []}))
  • enable (Boolean) (defaults to: lookup('profile::rsyslog::kafka_shipper::enable', {'default_value' => true}))


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
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'modules/profile/manifests/rsyslog/kafka_shipper.pp', line 16

class profile::rsyslog::kafka_shipper (
    Array   $logging_kafka_brokers = lookup('profile::rsyslog::kafka_shipper::kafka_brokers',
                                            {'default_value' => []}),
    Boolean $enable                = lookup('profile::rsyslog::kafka_shipper::enable',
                                            {'default_value' => true})
) {

    require_package('rsyslog-kafka')

    $ensure = $enable ? {
      true    => present,
      default => absent,
    }

    file { '/etc/rsyslog.lookup.d':
        ensure => directory,
    }

    file { '/etc/rsyslog.lookup.d/lookup_table_output.json':
        ensure  => $ensure,
        source  => 'puppet:///modules/profile/rsyslog/lookup_table_output.json',
        require => File['/etc/rsyslog.lookup.d'],
        notify  => Service['rsyslog'],
    }

    rsyslog::conf { 'max_message_size':
        ensure   => $ensure,
        content  => template('profile/rsyslog/max_message_size.conf.erb'),
        priority => 00,
    }

    rsyslog::conf { 'lookup_output':
        ensure   => $ensure,
        content  => template('profile/rsyslog/lookup_output.conf.erb'),
        priority => 10,
        require  => File['/etc/rsyslog.lookup.d/lookup_table_output.json'],
    }

    rsyslog::conf { 'template_syslog_json':
        ensure   => $ensure,
        source   => 'puppet:///modules/profile/rsyslog/template_syslog_json.conf',
        priority => 10,
    }

    rsyslog::conf { 'output_kafka':
        ensure   => $ensure,
        content  => template('profile/rsyslog/output_kafka.conf.erb'),
        priority => 30,
    }

    rsyslog::conf { 'output_local':
        ensure   => $ensure,
        content  => template('profile/rsyslog/output_local.conf.erb'),
        priority => 95,
    }

}