Defined Type: nagios::template

Defined in:
manifests/template.pp

Overview

Definition: nagios::template

Simple wrapper around a file resource, to ease nagios template creation.

Example:

nagios::template {"generic-service-active":
  conf_type => "service",
  content   => "
    use                     generic-service
    active_checks_enabled   1
    register                0",
}

Parameters:

  • content (Any)
  • conf_type (Any)
  • ensure (Any) (defaults to: present)


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'manifests/template.pp', line 15

define nagios::template(
  $content,
  $conf_type,
  $ensure    = present,
) {

  include ::nagios::params

  # set rights and owner
  file {"${nagios::params::resourcedir}/${conf_type}-${name}.cfg":
    ensure  => $ensure,
    owner   => root,
    group   => root,
    mode    => '0644',
    content => template('nagios/template-all.erb'),
    notify  => Exec['nagios-restart'],
  }
}