Puppet Class: icinga2::service

Defined in:
manifests/service.pp

Overview

== Class: icinga2::service

This class handles the Icinga 2 service. By default the service will start on boot and will be restarted if stopped.

=== Parameters

This class does not provide any parameters. To control the behaviour of this class, have a look at the parameters:

  • icinga2::ensure
  • icinga2::enable

=== Examples

This class is private and should not be called by others than this module.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'manifests/service.pp', line 17

class icinga2::service {

  assert_private()

  $ensure         = $::icinga2::ensure
  $enable         = $::icinga2::enable
  $manage_service = $::icinga2::manage_service
  $service_name   = $::icinga2::globals::service_name
  $reload         = $::icinga2::globals::service_reload
  $hasrestart     = $reload ? {
    undef   => false,
    default => true,
  }

  if $manage_service {
    service { $service_name:
      ensure     => $ensure,
      enable     => $enable,
      hasrestart => $hasrestart,
      restart    => $reload,
    }
  }

}