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,
}
}
|