Puppet Class: profile::toolforge::bastion

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

Overview

SPDX-License-Identifier: Apache-2.0 This profile sets up an bastion/dev instance in the Toolforge model.

Parameters:

  • component (String[1]) (defaults to: lookup('profile::wmcs::kubeadm::component'))


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

class profile::toolforge::bastion (
    String[1]              $component           = lookup('profile::wmcs::kubeadm::component'),
) {
    include profile::locales::all

    ensure_packages([
        'emacs-nox',
        'joe',  # T371556
        'neovim',
        'redis-tools',  # T410102
        'rsync',  # T362679
    ])

    include profile::toolforge::k8s::client

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

    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,
    }
}