Puppet Class: tcpircbot

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

Overview

SPDX-License-Identifier: Apache-2.0

Class: tcpircbot

Base class for tcpircbot, a daemon that reads messages from a TCP socket and writes them to an IRC channel. You should not need to override the defaults for this class's parameters. You likely need to simply 'include tcpircbot' and then provision an instance by declaring a 'tcpircbot::instance' resource. See instance.pp for the configuration options you do need to specify.

Parameters

dir

Directory for tcpircbot script and configuration files and home directory for user.

Examples

The following snippet will configure a bot nicknamed 'announcebot' that will sit on #wikimedia-operations on Libera.chat and forward messages that come in from private and loopback IPs on port 9200:

include tcpircbot

tcpircbot::instance { 'announcebot':
  channels => ['#wikimedia-operations'],
  password => $passwords::irc::announcebot,
}

Parameters:

  • dir (Any) (defaults to: '/srv/tcpircbot')


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/tcpircbot/manifests/init.pp', line 29

class tcpircbot(
    $dir         = '/srv/tcpircbot',
) {

    ensure_packages(['python3-irc', 'python3-netaddr'])

    group { 'tcpircbot':
        ensure => present,
        name   => 'tcpircbot',
    }

    user { 'tcpircbot':
        ensure     => present,
        gid        => 'tcpircbot',
        shell      => '/bin/false',
        home       => $dir,
        managehome => true,
        system     => true,
        require    => Group['tcpircbot'],
    }

    file { "${dir}/tcpircbot.py":
        ensure => present,
        source => 'puppet:///modules/tcpircbot/tcpircbot.py',
        owner  => 'tcpircbot',
        group  => 'tcpircbot',
        mode   => '0555',
    }
}