Puppet Class: systemd::slice::all_users

Defined in:
modules/systemd/manifests/slice/all_users.pp

Overview

Class systemd::slice::all_users

Sets up a Systemd user-.slice configuration meant to set up basic user limits for hosts shared by multiple users (like analytics crunching machines, toolforge hosts, etc..)

Parameters:

all_users_slice_config

Content of config file of the user-.slice unit. The limits will be enforced to every user slice separately (so not a global limit). Default: undef

all_users_global_slice_config

Content of config file of the user.slice unit. The limits will be enforced to all the processes under the user.slice, so a global limit. Default: undef

Parameters:

  • all_users_slice_config (Optional[String]) (defaults to: undef)
  • all_users_global_slice_config (Optional[String]) (defaults to: undef)


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
# File 'modules/systemd/manifests/slice/all_users.pp', line 21

class systemd::slice::all_users (
    Optional[String] $all_users_slice_config = undef,
    Optional[String] $all_users_global_slice_config = undef,
) {
    if $all_users_slice_config {
        systemd::unit { 'user-.slice':
            ensure   => present,
            content  => $all_users_slice_config,
            override => true,
        }
    }

    if $all_users_global_slice_config {
        systemd::unit { 'user.slice':
            ensure   => present,
            content  => $all_users_global_slice_config,
            override => true,
        }
    }

    # By default the root user does not have any limitation.
    # Caveat: this does not apply to sudo sessions, that
    # will be limited by the above user-.slice.
    # Caveat 2: limits for user.slice are also applied to
    # user-0.slice.
    systemd::unit { 'user-0.slice':
        ensure   => present,
        content  => file('systemd/root-slice-resource-control.conf'),
        override => true,
    }
}