Puppet Class: rsyslog::client

Inherits:
rsyslog
Defined in:
manifests/client.pp

Overview

Class: rsyslog::client

Full description of class role here.

Parameters

log_remote
spool_size
spool_timeoutenqueue
remote_type
remote_forward_format
log_local
log_local_custom
log_auth_local
listen_localhost
custom_config
custom_params
server
port
remote_servers
ssl_ca
ssl_permitted_peer

[*ssl_

log_templates
log_filters
actionfiletemplate
rate_limit_burst
rate_limit_interval

Variables

Examples

class { 'rsyslog::client': }

Parameters:

  • log_remote (Any) (defaults to: true)
  • spool_size (Any) (defaults to: '1g')
  • spool_timeoutenqueue (Any) (defaults to: false)
  • remote_type (Any) (defaults to: 'tcp')
  • remote_forward_format (Any) (defaults to: 'RSYSLOG_ForwardFormat')
  • log_local (Any) (defaults to: false)
  • log_local_custom (Any) (defaults to: undef)
  • log_auth_local (Any) (defaults to: false)
  • listen_localhost (Any) (defaults to: false)
  • split_config (Any) (defaults to: false)
  • custom_config (Any) (defaults to: undef)
  • custom_params (Any) (defaults to: undef)
  • server (Any) (defaults to: 'log')
  • port (Any) (defaults to: '514')
  • remote_servers (Any) (defaults to: false)
  • ssl_ca (Any) (defaults to: undef)
  • ssl_permitted_peer (Any) (defaults to: undef)
  • ssl_auth_mode (Any) (defaults to: 'anon')
  • log_templates (Any) (defaults to: false)
  • log_filters (Any) (defaults to: false)
  • actionfiletemplate (Any) (defaults to: false)
  • high_precision_timestamps (Any) (defaults to: false)
  • rate_limit_burst (Any) (defaults to: undef)
  • rate_limit_interval (Any) (defaults to: undef)
  • imfiles (Any) (defaults to: undef)


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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'manifests/client.pp', line 36

class rsyslog::client (
  $log_remote                = true,
  $spool_size                = '1g',
  $spool_timeoutenqueue      = false,
  $remote_type               = 'tcp',
  $remote_forward_format     = 'RSYSLOG_ForwardFormat',
  $log_local                 = false,
  $log_local_custom          = undef,
  $log_auth_local            = false,
  $listen_localhost          = false,
  $split_config              = false,
  $custom_config             = undef,
  $custom_params             = undef,
  $server                    = 'log',
  $port                      = '514',
  $remote_servers            = false,
  $ssl_ca                    = undef,
  $ssl_permitted_peer        = undef,
  $ssl_auth_mode             = 'anon',
  $log_templates             = false,
  $log_filters               = false,
  $actionfiletemplate        = false,
  $high_precision_timestamps = false,
  $rate_limit_burst          = undef,
  $rate_limit_interval       = undef,
  $imfiles                   = undef
) inherits rsyslog {

  if $custom_config {
    $content_real = template($custom_config)
  } elsif !$split_config {
    $content_real = template(
      "${module_name}/client/config.conf.erb",
      "${module_name}/client/remote.conf.erb",
      "${module_name}/client/local.conf.erb"
    )
  } else {
    $content_real = undef
  }

  if $content_real {
    rsyslog::snippet { $rsyslog::client_conf:
      ensure  => present,
      content => $content_real,
    }
  } else {
    if $remote_servers or $log_remote {
      $_remote_ensure = 'present'
    } else {
      $_remote_ensure = 'absent'
    }

    if $log_auth_local or $log_local {
      $_local_ensure = 'present'
    } else {
      $_local_ensure = 'absent'
    }

    rsyslog::snippet { "00_${rsyslog::client_conf}_config":
      ensure  => present,
      content => template("${module_name}/client/config.conf.erb"),
    }

    rsyslog::snippet { "50_${rsyslog::client_conf}_remote":
      ensure  => $_remote_ensure,
      content => template("${module_name}/client/remote.conf.erb"),
    }

    rsyslog::snippet { "99_${rsyslog::client_conf}_local":
      ensure  => $_local_ensure,
      content => template("${module_name}/client/local.conf.erb"),
    }
  }

  if $rsyslog::ssl and $ssl_ca == undef {
    fail('You need to define $ssl_ca in order to use SSL.')
  }

  if $rsyslog::ssl and $remote_type != 'tcp' {
    fail('You need to enable tcp in order to use SSL.')
  }

  if $ssl_auth_mode != 'anon' and $rsyslog::ssl == false {
    fail('You need to enable SSL in order to use ssl_auth_mode.')
  }

  if $ssl_permitted_peer and $ssl_auth_mode != 'x509/name' {
    fail('You need to set auth_mode to \'x509/name\' in order to use ssl_permitted_peers.')
  }

  if $imfiles {
    create_resources(rsyslog::imfile, $imfiles)
  }

}