Puppet Class: inspircd::config::ssl

Inherits:
inspircd::params
Defined in:
manifests/config/ssl.pp

Overview

Parameters:

  • certfile (Any) (defaults to: $inspircd::params::ssl_certfile)
  • keyfile (Any) (defaults to: $inspircd::params::ssl_keyfile)
  • dhfile (Any) (defaults to: undef)
  • cafile (Any) (defaults to: undef)
  • hash (Any) (defaults to: $inspircd::params::ssl_hash)
  • generate (Any) (defaults to: true)
  • module (Any) (defaults to: $inspircd::params::ssl_module)
  • extra_conf (Any) (defaults to: {})
  • add_bind (Any) (defaults to: $inspircd::params::ssl_add_bind)
  • bind_port (Any) (defaults to: $inspircd::params::bind_ssl_port)


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
# File 'manifests/config/ssl.pp', line 1

class inspircd::config::ssl (
  $certfile = $inspircd::params::ssl_certfile,
  $keyfile = $inspircd::params::ssl_keyfile,
  $dhfile = undef,
  $cafile = undef,
  $hash = $inspircd::params::ssl_hash,
  $generate = true,
  $module = $inspircd::params::ssl_module,
  $extra_conf = {},
  $add_bind = $inspircd::params::ssl_add_bind,
  $bind_port = $inspircd::params::bind_ssl_port,
) inherits inspircd::params {

  if($module == 'openssl'){
    $sslclass = 'inspircd::modules::openssl'
    $ssl_bind = 'openssl'
  }else{
    $sslclass = 'inspircd::modules::gnutls'
    $ssl_bind = 'gnutls'
  }

  $options = {
    certfile => $certfile,
    keyfile  => $keyfile,
    dhfile   => $dhfile,
    cafile   => $cafile,
    crlfile  => $crlfile,
    generate => $generate,
  }

  $final_options = merge($extra_conf, $options)

  ensure_resource('class', $sslclass, $final_options)

  if($add_bind){
    ::inspircd::config::bind { 'default ssl port':
      address => $::inspircd::config::bind_ip,
      port    => $bind_port,
      type    => 'clients',
      ssl     => $ssl_bind
    }
  }
}