added template concat
This commit is contained in:
@@ -19,6 +19,9 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# @summary Class manages /etc/nagios/conf.d/templates.cfg through concat.
|
||||
# @example cd_nagios::objects::templates { $name:
|
||||
# ng_template_object => 'service',
|
||||
# }
|
||||
################################################################################
|
||||
class cd_nagios::nagios::objects::template_rules (
|
||||
|
||||
@@ -41,5 +44,10 @@ class cd_nagios::nagios::objects::template_rules (
|
||||
content => template[$ng_templates_head_erb]
|
||||
notify => Service[$ng_service],
|
||||
}
|
||||
|
||||
# example rule
|
||||
cd_nagios::objects::templates { $name:
|
||||
ng_template_object => 'service',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,20 @@
|
||||
################################################################################
|
||||
define cd_nagios::nagios::objects::templates (
|
||||
|
||||
$ng_template_object = undef,
|
||||
|
||||
|
||||
) {
|
||||
|
||||
$ng_target_templates = $::cd_nagios::params::ng_target_templates
|
||||
$ng_nagios_server = $::cd_nagios::params::ng_nagios_server
|
||||
$ng_target_templates = $::cd_nagios::params::ng_target_templates
|
||||
$ng_templates_rule_erb = $::cd_nagios::params::ng_templates_rule_erb
|
||||
|
||||
if $::fqdn == $ng_nagios_server {
|
||||
|
||||
concat::fragment { $name:
|
||||
target => $ng_target_templates,
|
||||
content => template($ng_templates_rule_erb),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user