Puppet Class: mw_rc_irc::irc_echo

Defined in:
modules/mw_rc_irc/manifests/irc_echo.pp

Overview

Parameters:

  • ircpassword (Any)


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
# File 'modules/mw_rc_irc/manifests/irc_echo.pp', line 3

class mw_rc_irc::irc_echo(
    $ircpassword,
) {

        require_package('python-irc')

    file { '/etc/udpmxircecho-config.json':
        content => ordered_json({
            irc_oper_pass => $ircpassword,
            irc_nickname  => 'rc-pmtpa',
            irc_server    => 'localhost',
            irc_port      => 6667,
            irc_realname  => 'IRC echo bot',
            udp_port      => 9390
        }),
        mode    => '0444',
        owner   => 'irc',
        group   => 'irc'
    }

    file { '/usr/local/bin/udpmxircecho.py':
        source  => 'puppet:///modules/mw_rc_irc/udpmxircecho.py',
        mode    => '0555',
        owner   => 'irc',
        group   => 'irc',
        require => File['/etc/udpmxircecho-config.json']
    }

    file { '/etc/systemd/system/ircecho.service':
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        source  => 'puppet:///modules/mw_rc_irc/systemd/ircecho.service',
        require => File['/usr/local/bin/udpmxircecho.py'],
    }

    service { 'ircecho':
        ensure   => running,
        provider => 'systemd',
        require  => File['/etc/systemd/system/ircecho.service'],
    }

    # icinga check if bot process is running
    nrpe::monitor_service { 'ircecho-process':
        description  => 'ircecho bot process',
        nrpe_command => "/usr/lib/nagios/plugins/check_procs -c 1:1 -C python --ereg-argument-array '/usr/local/bin/udpmxircecho.py'",
        notes_url    => 'https://wikitech.wikimedia.org/wiki/Ircecho',
    }

}