Defined Type: monit::check

Defined in:
manifests/check.pp

Summary

Adds a Monit check.

Overview

Parameters:

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

    Specifies the content of the configuration file. The ‘content` and `source` parameters are exclusive of each other.

  • ensure (Enum['present', 'absent']) (defaults to: present)

    Tells Puppet whether the check should exist.

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

    Tells Puppet what is the path of the configuration file. The ‘content` and `source` parameters are exclusive of each other.



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
# File 'manifests/check.pp', line 13

define monit::check (
  Optional[String]          $content = undef,
  Enum['present', 'absent'] $ensure  = present,
  Optional[String]          $source  = undef,
) {
  # The base class must be included first because it is used by parameter defaults
  if ! defined(Class['monit']) {
    fail('You must include the monit base class before using any monit defined resources')
  }

  # <variable validations>
  if $source and $content {
    fail 'Parameters source and content are mutually exclusive'
  }
  # </variable validations>

  file { "${::monit::config_dir}/${name}":
    ensure  => $ensure,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    source  => $source,
    content => $content,
    require => Package['monit'],
    notify  => Service['monit'],
  }
}