Puppet Class: charybdis::serverinfo

Defined in:
manifests/serverinfo.pp

Overview

Parameters:

  • restartpass (Any)
  • diepass (Any)
  • server_name (Any) (defaults to: 'ircd.int')
  • server_id (Any) (defaults to: '42X')
  • server_description (Any) (defaults to: 'IRC server')
  • network_name (Any) (defaults to: 'IRC network')
  • network_description (Any) (defaults to: 'IRC network')
  • ssl_private_key (Any) (defaults to: false)
  • ssl_cert (Any) (defaults to: false)
  • ssl_dh_params (Any) (defaults to: false)
  • ssld_count (Any) (defaults to: '1')
  • hub (Any) (defaults to: true)
  • max_clients (Any) (defaults to: '1024')
  • virtual_ipv4 (Any) (defaults to: false)
  • virtual_ipv6 (Any) (defaults to: false)
  • conffile (Any) (defaults to: $charybdis::conffile)


1
2
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'manifests/serverinfo.pp', line 1

class charybdis::serverinfo (
  $restartpass,
  $diepass,
  $server_name         = 'ircd.int',
  $server_id           = '42X',
  $server_description  = 'IRC server',
  $network_name        = 'IRC network',
  $network_description = 'IRC network',
  $ssl_private_key     = false,
  $ssl_cert            = false,
  $ssl_dh_params       = false,
  $ssld_count          = '1',
  $hub                 = true,
  $max_clients         = '1024',
  $virtual_ipv4        = false,
  $virtual_ipv6        = false,
  $conffile            = $charybdis::conffile
) {
  #TODO Make the user/group for ircd to run as an option
  $hubtext = $hub ? {
    true  => 'yes',
    false => 'no',
  }

  Exec {
    logoutput => 'on_failure',
    path      => [
      '/bin',
      '/sbin',
      '/usr/bin',
      '/usr/sbin',
    ],
  }
  if $ssl_private_key and $ssl_cert {
    exec { 'Create private key and cert':
      command => "openssl req -x509 -nodes -newkey rsa:1024 -keyout ${ssl_private_key} -out ${ssl_cert} -subj '/C=US/ST=Oregon/L=Portland/O=PuppetLabs/CN=${server_name}'",
      creates => $ssl_private_key,
      require => Package['charybdis'],
      before  => [
        Concat[$conffile],
        File[$ssl_private_key],
        File[$ssl_cert],
      ],
    }
    file { $ssl_private_key:
      owner => 'root',
      group => 'charybdis',
    }
    file { $ssl_cert:
      owner => 'root',
      group => 'charybdis',
    }
  }
  if $ssl_dh_params {
    exec { 'Create dhparam':
      command => "openssl dhparam -out $ssl_dh_params 1024",
      creates => $ssl_dh_params,
      require => Package['charybdis'],
      before  => [
        Concat[$conffile],
        File[$ssl_dh_params],
      ],
    }
    file { $ssl_dh_params:
      owner => 'root',
      group => 'charybdis',
    }
  }

  concat::fragment { 'serverinfo conf':
    target  => $conffile,
    content => template('charybdis/serverinfo.erb'),
    order   => '002',
  }
}