Puppet Class: nagios_common::contacts
- Defined in:
- modules/nagios_common/manifests/contacts.pp
Overview
Class: nagios_common::contacts
Sets up appropriate contacts for notifications
- ensure
-
present or absent, to make the definition present or absent. Defaults to present
- config_dir
-
The base directory to put configuration directory in. Defaults to '/etc/icinga/'
- owner
-
The user which should own the check config files. Defaults to 'icinga'
- group
-
The group which should own the check config files. Defaults to 'icinga'
- contacts
-
The list of contacts to include in the configuration.
- source
-
Allows to input a prewritten file as a source. Overrides “content” if defined, but “content” is used if this is undefined.
- content
-
Allows to input the data as a content string. The default is template('nagios_common/contacts.cfg.erb')
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 |
# File 'modules/nagios_common/manifests/contacts.pp', line 31
class nagios_common::contacts(
$ensure = present,
$config_dir = '/etc/icinga',
$source = undef,
$content = undef,
$owner = 'icinga',
$group = 'icinga',
$contacts = [],
) {
if ($source != undef) {
file { "${config_dir}/contacts.cfg":
ensure => $ensure,
source => $source,
owner => $owner,
group => $group,
mode => '0440', # Only $owner:$group can read
show_diff => false,
}
} else {
if ($content == undef or empty($content)) {
$real_content = template('nagios_common/contacts.cfg.erb')
} else {
$real_content = $content
}
file { "${config_dir}/contacts.cfg":
ensure => $ensure,
content => $real_content,
owner => $owner,
group => $group,
mode => '0440', # Only $owner:$group can read
show_diff => false,
}
}
}
|