summaryrefslogtreecommitdiff
path: root/puppet/modules/leap/manifests/logfile.pp
blob: 42a82943bab0a1c7d03becd5954a3e5e1a2b7624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#
# make syslog log to a particular file for a particular process.
#

define leap::logfile($process=$title) {
  $logfile = "/var/log/leap/${title}.log"

  rsyslog::snippet { "50-${name}":
    content => "if \$programname startswith '${process}' then ${logfile}
&~"
  }

  augeas {
    "logrotate_${name}":
      context => "/files/etc/logrotate.d/${name}/rule",
      changes => [
        "set file ${logfile}",
        'set rotate 7',
        'set schedule daily',
        'set compress compress',
        'set missingok missingok',
        'set ifempty notifempty',
        'set copytruncate copytruncate'
      ]
  }
}