Puppet Class: icingaweb2::module::director::service

Defined in:
manifests/module/director/service.pp

Overview

Parameters:

  • ensure (Stdlib::Ensure::Service) (defaults to: 'running')

    Whether the director service should be running.

  • enable (Boolean) (defaults to: true)

    Enable or disable the service.

  • user (String) (defaults to: 'icingadirector')

    Specifies user to run director service daemon. Only available if install_method package is not used.

  • group (String) (defaults to: 'icingaweb2')

    Specifies primary group for user to run director service daemon. Only available if install_method package is not used.

  • manage_user (Boolean) (defaults to: true)

    Whether to manage the server user resource. Only available if install_method package is not used.



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
# File 'manifests/module/director/service.pp', line 24

class icingaweb2::module::director::service(
  Stdlib::Ensure::Service   $ensure      = 'running',
  Boolean                   $enable      = true,
  String                    $user        = 'icingadirector',
  String                    $group       = 'icingaweb2',
  Boolean                   $manage_user = true,
) {

  require ::icingaweb2::module::director

  $icingacli_bin  = $::icingaweb2::globals::icingacli_bin
  $install_method = $::icingaweb2::module::director::install_method

  if $install_method != 'package' {
    if $manage_user {
      user { $user:
        ensure => present,
        gid    => $group,
        shell  => '/bin/false',
        before => Systemd::Unit_file['icinga-director.service'],
      }
    }

    systemd::unit_file { 'icinga-director.service':
      content => template('icingaweb2/icinga-director.service.erb'),
      notify  => Service['icinga-director'],
    }
  }

  service {'icinga-director':
    ensure => $ensure,
    enable => $enable,
  }
}