Puppet Class: icinga2
- Defined in:
- manifests/init.pp
Summary
This module installs and configures Icinga 2.Overview
Note:
Setting manage_packages to false means that all package aren’t handeld by the module included the IDO packages.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'manifests/init.pp', line 114
class icinga2 (
Array[String[1]] $features,
Array[String[1]] $plugins,
Stdlib::Ensure::Service $ensure = running,
Boolean $enable = true,
Boolean $manage_repos = false,
Boolean $manage_packages = true,
Boolean $manage_selinux = false,
Boolean $manage_service = true,
Boolean $purge_features = true,
Hash[String[1], Any] $constants = {},
Variant[Boolean, String[1]] $confd = true,
) {
require icinga2::globals
$selinux_package_name = $icinga2::globals::selinux_package_name
# check selinux
$_selinux = if fact('os.selinux.enabled') and $facts['os']['selinux']['enabled'] and $selinux_package_name {
$manage_selinux
} else {
false
}
# load reserved words
$_reserved = $icinga2::globals::reserved
# merge constants with defaults
$_constants = $icinga2::globals::constants + $constants
# validate confd, boolean or string
if $confd =~ Boolean {
if $confd { $_confd = 'conf.d' } else { $_confd = undef }
} else {
$_confd = $confd
}
Class['icinga2::config']
-> Concat <| tag == 'icinga2::config::file' |>
~> Class['icinga2::service']
if $manage_repos {
require icinga::repos
}
class { 'icinga2::install': }
-> File <| ensure == 'directory' and tag == 'icinga2::config::file' |>
-> class { 'icinga2::config': notify => Class['icinga2::service'] }
-> File <| ensure != 'directory' and tag == 'icinga2::config::file' |>
~> class { 'icinga2::service': }
contain icinga2::install
contain icinga2::config
contain icinga2::service
include prefix($features, 'icinga2::feature::')
}
|