Puppet Class: icinga::worker

Defined in:
manifests/worker.pp

Summary

Setup a Icinga worker (aka satellite).

Overview

Parameters:

  • ca_server (Stdlib::Host)

    The CA to send the certificate request to.

  • zone (String[1])

    Name of the Icinga zone.

  • parent_zone (String[1]) (defaults to: 'main')

    Name of the parent Icinga zone.

  • parent_endpoints (Hash[String[1], Hash])

    Configures these endpoints of the parent zone.

  • colocation_endpoints (Hash[String[1], Hash]) (defaults to: {})

    When the zone includes more than one endpoint, set here the additional endpoint(s). Icinga supports two endpoints per zone only.

  • workers (Hash[String[1], Hash]) (defaults to: {})

    All cascading worker zones with key ‘endpoints’ for endpoint objects.

  • global_zones (Array[String[1]]) (defaults to: [])

    List of global zones to configure.

  • logging_type (Enum['file', 'syslog', 'eventlog'])

    Switch the log target. On Windows ‘syslog` is ignored, `eventlog` on all other platforms.

  • logging_level (Icinga::LogLevel)

    Set the log level.

  • run_web (Boolean) (defaults to: false)

    Prepare to run Icinga Web 2 on the same machine. Manage a group ‘icingaweb2` and add the Icinga user to this group.

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

    The private key to install.

  • ssh_key_type (Enum['ecdsa','ed25519','rsa']) (defaults to: rsa)

    SSH key type.



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
76
77
78
79
80
# File 'manifests/worker.pp', line 42

class icinga::worker (
  Stdlib::Host                       $ca_server,
  String[1]                          $zone,
  Hash[String[1], Hash]              $parent_endpoints,
  Enum['file', 'syslog', 'eventlog'] $logging_type,
  Icinga::LogLevel                   $logging_level,
  String[1]                          $parent_zone          = 'main',
  Hash[String[1], Hash]              $colocation_endpoints = {},
  Hash[String[1], Hash]              $workers              = {},
  Array[String[1]]                   $global_zones         = [],
  Boolean                            $run_web              = false,
  Optional[Icinga::Secret]           $ssh_private_key      = undef,
  Enum['ecdsa','ed25519','rsa']      $ssh_key_type         = rsa,
) {
  # inject parent zone if no parent exists
  $_workers = $workers.reduce({}) |$memo, $worker| { $memo + { $worker[0] => { parent => $zone } + $worker[1] } }

  class { 'icinga':
    ca              => false,
    ca_server       => $ca_server,
    this_zone       => $zone,
    zones           => {
      'ZoneName'   => { 'endpoints' => { 'NodeName' => {} } + $colocation_endpoints, 'parent' => $parent_zone, },
      $parent_zone => { 'endpoints' => $parent_endpoints, },
    } + $_workers,
    logging_type    => $logging_type,
    logging_level   => $logging_level,
    ssh_key_type    => $ssh_key_type,
    ssh_private_key => $ssh_private_key,
    prepare_web     => $run_web,
  }

  include icinga2::feature::checker

  icinga2::object::zone { $global_zones:
    global => true,
    order  => 'zz',
  }
}