33 lines
1.3 KiB
Puppet
33 lines
1.3 KiB
Puppet
## cd_nagios::nagios::objects::add_hostgroups.pp
|
|
# Module name: cd_nagios
|
|
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
|
# @summary define populates /etc/nagios/conf.d/nagios_hostgroups_add through
|
|
# external Puppet rules.
|
|
# @example
|
|
# cd_nagios::nagios::objects::add_hostgroups { 'example_hostgroup':
|
|
# ng_hostgroup_name => 'example_hostgroup',
|
|
# ng_hostgroup_alias => 'Example Hostgroup',
|
|
# }
|
|
# @param [string] ng_hostgroup_name Specify the hostgroup short name.
|
|
# @param [string] ng_hostgroup_alias Specify the hostgroup alias (long name).
|
|
# @param [string] ng_hostgroup_register Whether to register the hostgroup.
|
|
###############################################################################
|
|
define cd_nagios::nagios::objects::add_hostgroups (
|
|
|
|
Optional[String] $ng_hostgroup_name = undef,
|
|
Optional[String] $ng_hostgroup_alias = undef,
|
|
String $ng_hostgroup_register = '1',
|
|
|
|
) {
|
|
$ng_nagios_server = $cd_nagios::params::ng_nagios_server
|
|
$ng_tgt_hostgroup_add = $cd_nagios::params::ng_tgt_hostgroup_add
|
|
$ng_tgt_hostgrp_rule_erb = $cd_nagios::params::ng_tgt_hostgrp_rule_erb
|
|
|
|
if $::fqdn == $ng_nagios_server {
|
|
concat::fragment { $name:
|
|
target => $ng_tgt_hostgroup_add,
|
|
content => template($ng_tgt_hostgrp_rule_erb),
|
|
}
|
|
}
|
|
}
|