summaryrefslogtreecommitdiff
path: root/puppet/modules/site_config/manifests/syslog.pp
blob: 83b49c8ef82d1e229f2d0634b0241992c85a763a (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
27
28
29
30
31
32
33
34
35
36
37
38
39
class site_config::syslog {

  include site_apt::preferences::rsyslog

  class { 'rsyslog::client':
    log_remote => false,
    log_local  => true
  }

  rsyslog::snippet { '00-anonymize_logs':
    content => '$ModLoad mmanon
action(type="mmanon" ipv4.bits="32" mode="rewrite")'
  }

  augeas {
    'logrotate_leap_deploy':
      context => '/files/etc/logrotate.d/leap_deploy/rule',
      changes => [ 'set file /var/log/leap/deploy.log',
                   'set rotate 5',
                   'set size 1M',
                   'set compress compress',
                   'set missingok missingok',
                   'set copytruncate copytruncate' ];

    # NOTE:
    # the puppet_command script requires the option delaycompress
    # be set on the summary log file.

    'logrotate_leap_deploy_summary':
      context => '/files/etc/logrotate.d/leap_deploy_summary/rule',
      changes => [ 'set file /var/log/leap/deploy-summary.log',
                   'set rotate 5',
                   'set size 100k',
                   'set delaycompress delaycompress',
                   'set compress compress',
                   'set missingok missingok',
                   'set copytruncate copytruncate' ]
  }
}