Puppet Class: profile::toolforge::bastion

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

Overview

This profile sets up an bastion/dev instance in the Toolforge model.



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
# File 'modules/profile/manifests/toolforge/bastion.pp', line 2

class profile::toolforge::bastion () {
    if debian::codename::eq('buster') {
        include profile::toolforge::shell_environ
    } else {
        include profile::locales::all

        ensure_packages([
            'emacs-nox',
            'rsync',  # T362679
            'neovim',
        ])
    }

    include profile::toolforge::k8s::client

    file { '/bin/disabledtoolshell':
        ensure => file,
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
        source => 'puppet:///modules/profile/toolforge/disabledtoolshell',
    }

    # misctools is in the tools aptly repo
    ensure_packages(['misctools'], {
        ensure => latest,
    })

    motd::script { 'bastion-banner':
        ensure => present,
        source => "puppet:///modules/profile/toolforge/40-${::wmcs_project}-bastion-banner.sh",
    }

    package { 'mosh':
        ensure => present,
    }

    $grid_off_script = @("GRIDOFF"/L)
       #!/bin/bash
       echo 'The grid engine has been shut off, for more information see:'
       echo 'https://wikitech.wikimedia.org/wiki/News/Toolforge_Grid_Engine_deprecation'
       exit 1
       | GRIDOFF

    # /usr/local/bin has precedence in $PATH to /usr/bin
    file { [
      '/usr/local/bin/qstat',
      '/usr/local/bin/jsub',
      '/usr/local/bin/crontab',
    ]:
        ensure  => file,
        owner   => 'root',
        group   => 'root',
        mode    => '0655',
        content => $grid_off_script,
    }

    apt::repository { 'thirdparty-tekton':
        ensure     => absent,
        uri        => 'http://apt.wikimedia.org/wikimedia',
        dist       => "${::lsbdistcodename}-wikimedia",
        components => 'thirdparty/tekton',
    }
}