Defined Type: nrpe::plugin

Defined in:
modules/nrpe/manifests/plugin.pp

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • source (Optional[Stdlib::Filesource]) (defaults to: undef)

    a puppet Source to the script file

  • content (Optional[String]) (defaults to: undef)

    String content of the script

  • ensure (Wmflib::Ensure) (defaults to: present)

    whether this script should be present or not



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'modules/nrpe/manifests/plugin.pp', line 6

define nrpe::plugin (
    Optional[Stdlib::Filesource] $source  = undef,
    Optional[String]             $content = undef,
    Wmflib::Ensure               $ensure  = present,
) {
    if $ensure == 'present' and $source == undef and $content == undef {
        fail('Either source or content attribute needs to be given')
    }
    if $source != undef and $content != undef {
        fail('Both source and content attribute have been defined')
    }

    @file { "/usr/local/lib/nagios/plugins/${title}":
        ensure  => stdlib::ensure($ensure, 'file'),
        source  => $source,
        content => $content,
        owner   => 'root',
        group   => 'root',
        mode    => '0555',
        tag     => 'nrpe::plugin',
    }
}