Files
confdroid_nagios/manifests/nagios/objects/add_contactgroups.pp

35 lines
1.4 KiB
ObjectPascal
Raw Normal View History

2026-03-01 15:12:15 +01:00
## confdroid_nagios::nagios::objects::add_contactgroups.pp
# Module name: confdroid_nagios
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Define populates /etc/nagios/conf.d/nagios_add_contactgroups through
# external puppet rules.
# @param [string] ng_contactgroup_name Specify the short name of the
# contact group.
# @param [string] ng_contactgroup_alias Specify the alias (long name) of the
# contact group
# @param [string] ng_contactgroup_register Specify whether the contact group
# should be registered in Nagios.
2026-03-01 17:17:00 +01:00
# @param [string] ng_contactgroup_members Specify the members of the contact
# group.
2026-03-01 15:12:15 +01:00
################################################################################
define confdroid_nagios::nagios::objects::add_contactgroups (
Optional[String] $ng_contactgroup_name = undef,
Optional[String] $ng_contactgroup_alias = undef,
2026-03-01 17:32:00 +01:00
Optional[String] $ng_contactgroup_members = undef,
2026-03-01 15:12:15 +01:00
String $ng_contactgroup_register = '1',
) {
$ng_nagios_server = $confdroid_nagios::params::ng_nagios_server
$ng_tgt_contactgroup_add = $confdroid_nagios::params::ng_tgt_contactgroup_add
$ng_cntctgrps_rule_erb = $confdroid_nagios::params::ng_cntctgrps_rule_erb
2026-03-01 17:00:59 +01:00
$fqdn = $facts['networking']['fqdn']
2026-03-01 15:12:15 +01:00
if $ng_nagios_server == $fqdn {
concat::fragment { $name:
target => $ng_tgt_contactgroup_add,
content => template($ng_cntctgrps_rule_erb),
}
}
}