Puppet Class: profile::toolforge::base

Defined in:
modules/profile/manifests/toolforge/base.pp

Overview

Parameters:

  • is_mail_relay (Any) (defaults to: hiera('profile::toolforge::is_mail_relay', false))
  • active_mail_relay (Any) (defaults to: hiera('profile::toolforge::active_mail_relay', 'tools-mail-02.tools.eqiad.wmflabs'))
  • mail_domain (Any) (defaults to: hiera('profile::toolforge::mail_domain', 'tools.wmflabs.org'))


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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'modules/profile/manifests/toolforge/base.pp', line 1

class profile::toolforge::base(
    $is_mail_relay = hiera('profile::toolforge::is_mail_relay', false),
    $active_mail_relay = hiera('profile::toolforge::active_mail_relay', 'tools-mail-02.tools.eqiad.wmflabs'),
    $mail_domain = hiera('profile::toolforge::mail_domain', 'tools.wmflabs.org'),
) {
    require ::profile::toolforge::clush::target

    package { 'nano':
        ensure => latest,
    }

    alternatives::select { 'editor':
        path => '/bin/nano',
    }

    file { '/root/.bashrc':
        ensure => file,
        source => 'puppet:///modules/profile/toolforge/rootrc',
        owner  => 'root',
        group  => 'root',
        mode   => '0750',
    }

    # Users can choose their shell accounts names freely, and some
    # choose ones that can be misleading to third parties inter alia
    # when they are used to send and receive mail at
    # "$user@tools.wmflabs.org".  The most common ones are already
    # addressed by the default system aliases for "abuse",
    # "postmaster", "webmaster", etc., so we only have to add aliases
    # here that have not been standardized per se, but still bear a
    # high risk of mimicry.
    mailalias { [ 'admin', 'administrator' ]:
        ensure    => present,
        recipient => 'root',
    }

    if !$is_mail_relay {
        class { '::exim4':
            queuerunner => 'combined',
            config      => template('profile/toolforge/route-to-mail-relay.exim4.conf.erb'),
            variant     => 'light',
        }
    }

    # Silence e-mails sent when regular users try to sudo (T95882)
    file { '/etc/sudoers.d/40-tools-sudoers-no-warning':
        ensure => file,
        mode   => '0440',
        owner  => 'root',
        group  => 'root',
        source => 'puppet:///modules/profile/toolforge/40-tools-sudoers-no-warning',
    }

    file { '/etc/security/limits.d/50-no-bigfiles.conf':
        ensure => file,
        mode   => '0444',
        owner  => 'root',
        group  => 'root',
        source => 'puppet:///modules/profile/toolforge/50-no-bigfiles.conf',
    }

    file { '/usr/local/bin/log-command-invocation':
        ensure => present,
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
        source => 'puppet:///modules/profile/toolforge/log-command-invocation',
    }
}