Puppet Class: bacula::director::logwatch

Defined in:
manifests/director/logwatch.pp

Overview

Class: bacula::director::logwatch

The EPEL bacula-director-common package requires logwatch and installs configs specifically for it. Since we move the logs we should probably also update the logwatch configs as well.

Parameters

All bacula classes are called from the main ::bacula class. Parameters are documented there.

Copyright 2012 Russell Harrison

License

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Parameters:

  • logwatch_enabled (Any) (defaults to: true)


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
# File 'manifests/director/logwatch.pp', line 29

class bacula::director::logwatch (
  $logwatch_enabled = true
) {
  Class['::bacula::director'] -> Class['::bacula::director::logwatch']

  $config_ensure = $logwatch_enabled ? {
    false   => absent,
    default => file,
  }

  file { '/etc/logwatch/conf/logfiles/bacula.conf':
    ensure  => $config_ensure,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template('bacula/logwatch/logfiles.conf.erb'),
  }

  file { '/etc/logwatch/conf/services/bacula.conf':
    ensure  => $config_ensure,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template('bacula/logwatch/services.conf.erb'),
  }

  $services_source = $::operatingsystem ? {
    /(Debian|Ubuntu)/ => 'puppet:///modules/bacula/logwatch/bacula.pl',
    default           => undef,
  }

  # Apparently the Ubuntu and Debian packages don't include the logwatch scripts so we'll need to provide them. The EPEL and Fedora
  # packages include the scripts so we'll allow the content to be updated with the rpms.
  file { '/etc/logwatch/scripts/services/bacula':
    ensure => file,
    owner  => 'root',
    group  => 'root',
    mode   => '0755',
    source => $services_source,
  }

  $applybaculadate_source = $::operatingsystem ? {
    /(Debian|Ubuntu)/ => 'puppet:///modules/bacula/logwatch/applybaculadate.pl',
    default           => undef,
  }

  file { '/etc/logwatch/scripts/shared/applybaculadate':
    ensure => file,
    owner  => 'root',
    group  => 'root',
    mode   => '0755',
    source => $applybaculadate_source,
  }
}