Puppet Class: icinga::web::icingadb

Defined in:
manifests/web/icingadb.pp

Summary

Setup IcingaDB module for the new backend.

Overview

Parameters:

  • db_type (Enum['mysql', 'pgsql'])

    What kind of database type to use as backend.

  • db_host (Stdlib::Host) (defaults to: 'localhost')

    Database host to connect for the backenend.

  • db_port (Optional[Stdlib::Port::Unprivileged]) (defaults to: undef)

    Port to connect the backend.

  • db_name (String) (defaults to: 'icingadb')

    Name of the database backend.

  • db_user (String) (defaults to: 'icingadb')

    Database backend user name.

  • db_pass (Icinga::Secret)

    Password to connect the backend.

  • redis_host (Stdlib::Host) (defaults to: 'localhost')

    Redis host to connect.

  • redis_port (Optional[Stdlib::Port]) (defaults to: undef)

    Connect ‘redis_host` om this port.

  • redis_pass (Optional[Icinga::Secret]) (defaults to: undef)

    Password for Redis connection.

  • redis_primary_host (Stdlib::Host) (defaults to: $redis_host)

    Alternative parameter to use for ‘redis_host`. Useful for high availability environments.

  • redis_primary_port (Optional[Stdlib::Port]) (defaults to: $redis_port)

    Alternative parameter to use for ‘redis_port`. Useful for high availability environments.

  • redis_primary_pass (Optional[Icinga::Secret]) (defaults to: $redis_pass)

    Alternative parameter to use for ‘redis_passwod`. Useful for high availability environments.

  • redis_secondary_host (Optional[Stdlib::Host]) (defaults to: undef)

    Fallback Redis host to connect if the first one fails.

  • redis_secondary_port (Optional[Stdlib::Port]) (defaults to: undef)

    Port to connect on the fallback Redis server.

  • redis_secondary_pass (Optional[Icinga::Secret]) (defaults to: undef)

    Password for the second Redis server.



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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'manifests/web/icingadb.pp', line 49

class icinga::web::icingadb (
  Icinga::Secret                        $db_pass,
  Enum['mysql', 'pgsql']                $db_type,
  Stdlib::Host                          $db_host              = 'localhost',
  Optional[Stdlib::Port::Unprivileged]  $db_port              = undef,
  String                                $db_name              = 'icingadb',
  String                                $db_user              = 'icingadb',
  Stdlib::Host                          $redis_host           = 'localhost',
  Optional[Stdlib::Port]                $redis_port           = undef,
  Optional[Icinga::Secret]              $redis_pass           = undef,
  Stdlib::Host                          $redis_primary_host   = $redis_host,
  Optional[Stdlib::Port]                $redis_primary_port   = $redis_port,
  Optional[Icinga::Secret]              $redis_primary_pass   = $redis_pass,
  Optional[Stdlib::Host]                $redis_secondary_host = undef,
  Optional[Stdlib::Port]                $redis_secondary_port = undef,
  Optional[Icinga::Secret]              $redis_secondary_pass = undef,
) {
  require icinga::web

  $api_host = $icinga::web::api_host
  $api_user = $icinga::web::api_user
  $api_pass = $icinga::web::api_pass

  class { 'icingaweb2::module::icingadb':
    db_type                  => $db_type,
    db_host                  => $db_host,
    db_port                  => $db_port,
    db_name                  => $db_name,
    db_username              => $db_user,
    db_password              => $db_pass,
    db_charset               => 'UTF8',
    redis_primary_host       => $redis_primary_host,
    redis_primary_port       => $redis_primary_port,
    redis_primary_password   => $redis_primary_pass,
    redis_secondary_host     => $redis_secondary_host,
    redis_secondary_port     => $redis_secondary_port,
    redis_secondary_password => $redis_secondary_pass,
  }

  any2array($api_host).each |Stdlib::Host $host| {
    icingaweb2::module::icingadb::commandtransport { $host:
      host     => $host,
      username => $api_user,
      password => $api_pass,
    }
  }
}