Defined Type: syslogng::destination::syslog::logpath

Defined in:
manifests/destination/syslog/logpath.pp

Overview

Define: syslogng::destination::syslog::logpath

Define used to create the logpath for individual syslogng::destination needed for each syslog destination.

Do not use this class directly it is not considered part of the public api.

Parameters:

  • ensure (Any) (defaults to: present)
  • conf_dir (Any) (defaults to: '/etc/syslog-ng')
  • priority (Any) (defaults to: 00)
  • destination (Any) (defaults to: undef)
  • logpath (Any) (defaults to: undef)


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
# File 'manifests/destination/syslog/logpath.pp', line 8

define syslogng::destination::syslog::logpath (
  $ensure   = present,
  $conf_dir = '/etc/syslog-ng',
  $priority = 00,
  $destination = undef,
  $logpath = undef,
) {
  validate_re($ensure, ['^present$', '^absent$'])

  $ensure_file = $ensure ? {
    present => file,
    default => $ensure,
  }

  $logpath_name = $logpath ? {
    undef   => $title,
    default => $logpath,
  }

  file { "${conf_dir}/syslog-ng.conf.d/log.d/${priority}_syslog_${title}.conf":
    ensure  => $ensure_file,
    content => template('syslogng/syslog-ng.conf.d/log.d/syslog.conf.erb'),
  }

}