Puppet Class: icingaweb2::module::vspheredb::service

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

Summary

Installs and configures the vspheredb service.

Overview

Note:

Only systemd is supported by the Icinga Team and this module.

Examples:

include icingaweb2::module::vspheredb::service

Parameters:

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

    Whether the vspheredb service should be running.

  • enable (Boolean) (defaults to: true)

    Enable or disable the service.

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

    Specifies the user to run the vsphere service daemon as. Only available if install_method package is not used.

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

    Specifies the primary group to run the vspheredb service daemon as. 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.



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
58
59
60
61
62
63
64
65
66
67
# File 'manifests/module/vspheredb/service.pp', line 26

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

  require ::icingaweb2::module::vspheredb

  $install_method = $icingaweb2::module::vspheredb::install_method

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

    systemd::tmpfile { 'icinga-vspheredb.conf':
      content => "d /run/icinga-vspheredb 0755 ${user} ${group} -",
      before  => Systemd::Unit_file['icinga-vspheredb.service'],
    }

    systemd::unit_file { 'icinga-vspheredb.service':
      ensure  => 'present',
      content => epp('icingaweb2/icinga-vspheredb.service.epp', {
        'conf_user'     => $user,
        'icingacli_bin' => $icingaweb2::globals::icingacli_bin,
      }),
      notify  => Service['icinga-vspheredb'],
    }
  }

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