Puppet Class: profile::toolforge::clush::master

Defined in:
modules/profile/manifests/toolforge/clush/master.pp

Overview

Parameters:

  • observer_pass (String) (defaults to: lookup('profile::openstack::eqiad1::observer_password'))


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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'modules/profile/manifests/toolforge/clush/master.pp', line 6

class profile::toolforge::clush::master(
    String $observer_pass = lookup('profile::openstack::eqiad1::observer_password'),
    ) {

    require ::profile::openstack::eqiad1::clientpackages::vms

    class { '::clush::master':
        username => 'clushuser',
    }

    require_package('python3-yaml')

    file { '/usr/local/sbin/tools-clush-generator':
        ensure => file,
        source => 'puppet:///modules/profile/toolforge/clush/tools-clush-generator.py',
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
    }

    file { '/usr/local/sbin/tools-clush-interpreter':
        ensure => file,
        source => 'puppet:///modules/profile/toolforge/clush/tools-clush-interpreter.py',
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
    }

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

    # TODO: Remove after change is applied
    cron { 'update_tools_clush':
        ensure  => absent,
    }

    systemd::timer::job { 'toolforge_clush_update':
        ensure                    => present,
        description               => 'Update list of Toolforge servers for clush',
        command                   => "/usr/local/sbin/tools-clush-generator /etc/clustershell/tools.yaml --observer-pass ${observer_pass}",
        interval                  => {
            'start'    => 'OnCalendar',
            'interval' => '*-*-* *:00:00', # hourly
        },
        logging_enabled           => false,
        monitoring_enabled        => true,
        monitoring_contact_groups => 'wmcs-team',
        user                      => 'root',
    }

    $groups_config = {
        'Main' => {
            'default' => 'Tools',
        },
        'Tools' => {
            'map' => '/usr/local/sbin/tools-clush-interpreter --hostgroups /etc/clustershell/tools.yaml map $GROUP',
            'list' => '/usr/local/sbin/tools-clush-interpreter --hostgroups /etc/clustershell/tools.yaml list',
        },
    }

    file { '/etc/clustershell/groups.conf':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => ini($groups_config),
    }

    # Usage: `clush --hostfile /etc/clustershell/toolforge_canary_list.txt 'cmd'`
    file { '/etc/clustershell/toolforge_canary_list.txt':
        ensure => file,
        source => 'puppet:///modules/profile/toolforge/clush/toolforge_canary_list.txt',
        owner  => 'root',
        group  => 'root',
        mode   => '0644',
    }
}