Puppet Class: mtail

Defined in:
modules/mtail/manifests/init.pp

Overview

Parameters:

  • logs (Array[Stdlib::Unixpath]) (defaults to: ['/var/log/syslog'])
  • port (Stdlib::Port) (defaults to: 3903)
  • service_ensure (Wmflib::Ensure) (defaults to: 'present')
  • group (String) (defaults to: 'root')
  • from_component (Boolean) (defaults to: false)


19
20
21
22
23
24
25
26
27
28
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
# File 'modules/mtail/manifests/init.pp', line 19

class mtail (
    Array[Stdlib::Unixpath] $logs   = ['/var/log/syslog'],
    Stdlib::Port $port              = 3903,
    Wmflib::Ensure $service_ensure  = 'present',
    String $group                   = 'root',
    Boolean $from_component         = false
) {
    if ( $from_component ) {
        apt::package_from_component { 'mtail':
            component => 'component/mtail'
        }
    } else {
        if os_version('debian == stretch') {
            apt::pin { 'mtail':
                pin      => 'release a=stretch-backports',
                package  => 'mtail',
                priority => '1001',
                before   => Package['mtail'],
            }
        }
        # Not using require_package so apt::pin may be
        # applied before attempting to install mtail.
        package { 'mtail':
            ensure => present,
        }
    }

    file { '/etc/default/mtail':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => template('mtail/default.erb'),
        notify  => Service['mtail'],
    }

    systemd::service { 'mtail':
        ensure  => $service_ensure,
        content => systemd_template('mtail'),
        restart => true,
    }
}