Puppet Class: systemd::coredump

Defined in:
modules/systemd/manifests/coredump.pp

Overview

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: absent)


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
# File 'modules/systemd/manifests/coredump.pp', line 10

class systemd::coredump (
    Wmflib::Ensure $ensure = absent
){
    require ::systemd
    $exec_label = 'systemd daemon-reload for coredump'
        file { '/etc/systemd/coredump.conf':
            ensure => $ensure,
            source => 'puppet:///modules/systemd/coredump.conf',
            mode   => '0444',
            owner  => 'root',
            group  => 'root',
            notify => Exec[$exec_label],
        }
    exec { $exec_label:
        refreshonly => true,
        command     => '/bin/systemctl daemon-reload',
    }

    # That should always be there so any leftover files on a
    # server where coredump is not enabled any more, will be removed
    systemd::tmpfile { 'coredump':
        content => 'd /var/lib/systemd/coredump 0755 root root 15d',
    }
    sysctl::parameters { 'coredump':
        ensure => $ensure,
        values => {
            'kernel.core_pattern' => '|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %e'
        }
    }
}