Puppet Function: tp::fail

Defined in:
functions/fail.pp
Function type:
Puppet Language

Overview

tp::fail(Tp::Fail $on_missing_data, String $message)Any

Function tp::fail. Uses the approach provided via the first argument to manage the notification of the message in the second argument

Parameters:

  • on_missing_data (Tp::Fail)
  • message (String)

Returns:

  • (Any)


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'functions/fail.pp', line 4

function tp::fail (
  Tp::Fail $on_missing_data,
  String $message,
) {
  case $on_missing_data {
    'alert': {
      alert($message)
    }
    'crit': {
      crit($message)
    }
    'debug': {
      debug($message)
    }
    'emerg': {
      emerg($message)
    }
    'err': {
      err($message)
    }
    'info': {
      info($message)
    }
    'notice': {
      notice($message)
    }
    'warning': {
      warning($message)
    }
    'notify': {
      notify { "tp_fail_${message}":
        message  => $message,
        loglevel => 'warning',
      }
    }
    'ignore': {
      # do nothing
    }
    default: {
      info($message)
    }
  }
}