Puppet Class: ircecho

Defined in:
modules/ircecho/manifests/init.pp

Overview

IRC echo class To use this class, you must define some parameters; here's an example (leading hashes on channel names are added for you if missing): $ircecho_logs =

"/var/log/nagios/irc.log" =>
["wikimedia-operations","#wikimedia-tech"],
"/var/log/nagios/irc2.log" => "#irc2",

$ircecho_nick = “icinga-wm” $ircecho_server = “chat.freenode.net 6667”

Parameters:

  • ircecho_logs (Any)
  • ircecho_nick (Any)
  • ircecho_server (Any) (defaults to: 'chat.freenode.net +6697')
  • ident_passwd_file (Any) (defaults to: undef)
  • ensure (Any) (defaults to: 'present')


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
# File 'modules/ircecho/manifests/init.pp', line 11

class ircecho (
    $ircecho_logs,
    $ircecho_nick,
    $ircecho_server = 'chat.freenode.net +6697',
    $ident_passwd_file = undef,
    $ensure = 'present',
) {

    require_package(['python-pyinotify', 'python-irc'])

    file { '/usr/local/bin/ircecho':
        ensure => 'present',
        source => 'puppet:///modules/ircecho/ircecho.py',
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
        notify => Service['ircecho'],
    }
    file { '/usr/local/lib/python2.7/dist-packages/ib3_auth.py':
        ensure => 'present',
        source => 'puppet:///modules/ircecho/ib3_auth.py',
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
        notify => Service['ircecho'],
    }

    file { '/etc/default/ircecho':
        ensure  => 'present',
        content => template('ircecho/default.erb'),
        owner   => 'root',
        mode    => '0755',
        notify  => Service['ircecho'],
    }

    systemd::service { 'ircecho':
        ensure         => $ensure,
        content        => systemd_template('ircecho'),
        service_params => {
            hasrestart => true,
        },
        require        => File['/usr/local/bin/ircecho'],
    }


    base::service_auto_restart { 'ircecho': }
}