Defined Type: limnoria::bot

Defined in:
manifests/bot.pp

Summary

configure a limnoria bot

Overview

Parameters:

  • server_fqdn (Stdlib::FQDN)

    The FQDN of the server the bot should connect to.

  • server_name (String)

    The name of the server the bot should connect to.

  • nick (String)

    The nick of the bot.

  • port (Integer)

    The port on the server the bot should connect to.

  • ssl (Boolean)

    If the bot should connect to the server using TLS or not.

  • channels (Array[String])

    A list of channels the bot should connect to on the server.

  • owner_info (String)

    Information identifying the bot’s owner on the IRC server.

  • sasl_password (Optional[String])

    The password the bot should use to register on the server’s NickServ

  • custom_options (Optional[Hash])

    All other options you want to pass to the configuration file.



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
# File 'manifests/bot.pp', line 30

define limnoria::bot (
  Stdlib::FQDN      $server_fqdn,
  String            $server_name,
  String            $nick,
  Integer           $port,
  Boolean           $ssl,
  Array[String]     $channels,
  String            $owner_info,
  Optional[String]  $sasl_password,
  Optional[Hash]    $custom_options,
) {

  service {
    "limnoria@${name}":
      ensure     => running,
      hasrestart => true,
      hasstatus  => true,
      enable     => true,
      require    => File['/etc/systemd/system/limnoria@.service'];
  }

  file {
    "/home/${limnoria::user}/${name}.conf":
      ensure  => file,
      content => epp('limnoria/bot.conf.epp', {
        'user'           => $limnoria::user,
        'server_fqdn'    => $server_fqdn,
        'server_name'    => $server_name,
        'nick'           => $nick,
        'port'           => $port,
        'ssl'            => $ssl,
        'channels'       => $channels,
        'log_dir'        => $limnoria::log_dir,
        'owner_info'     => $owner_info,
        'sasl_password'  => $sasl_password,
        'custom_options' => $custom_options,
      }),
      owner   => $limnoria::user,
      group   => $limnoria::group,
      mode    => '0600',
      notify  => Service["limnoria@${name}"];
  }
}