-
-
Notifications
You must be signed in to change notification settings - Fork 94
/
install.pp
49 lines (44 loc) · 1.23 KB
/
install.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
# @summary
# This class handles the installation of the Icinga 2 package.
# On Windows only chocolatey is supported as installation source.
#
# @api private
#
class icinga2::install {
assert_private()
$package_name = $icinga2::globals::package_name
$manage_packages = $icinga2::manage_packages
$manage_selinux = $icinga2::_selinux
$selinux_package_name = $icinga2::globals::selinux_package_name
$cert_dir = $icinga2::globals::cert_dir
$conf_dir = $icinga2::globals::conf_dir
$user = $icinga2::globals::user
$group = $icinga2::globals::group
if $manage_packages {
if $facts['os']['family'] == 'windows' { Package { provider => chocolatey, } }
package { $package_name:
ensure => installed,
before => File[$cert_dir, $conf_dir],
}
if $manage_selinux {
package { $selinux_package_name:
ensure => installed,
require => Package[$package_name],
}
}
}
file {
default:
ensure => directory,
owner => $user,
group => $group,
mode => '0750',
;
$conf_dir:
seltype => 'icinga2_etc_t',
;
$cert_dir:
seltype => 'icinga2_var_lib_t',
;
}
}