Puppet Class: shinken

Overview

Class: shinken

Full description of class shinken here.

Parameters

Document parameters here.

sample_parameter

Explanation of what this parameter affects and what it defaults to. e.g. “Specify one or more upstream ntp servers as an array.”

Variables

Here you should define a list of variables that this module would require.

sample_variable

Explanation of how this variable affects the funtion of this class and if it has a default. e.g. “The parameter enc_ntp_servers must be set by the External Node Classifier as a comma separated list of hostnames.” (Note, global variables should be avoided in favor of class parameters as of Puppet 2.6.)

Examples

class { 'shinken':
  servers => [ 'pool.ntp.org', 'ntp.local.company.com' ],
}

Authors

Author Name <author@domain.com>

Copyright 2015 Your name here, unless otherwise noted.

Parameters:

  • ensure (Any) (defaults to: 'present')
  • user (Any) (defaults to: 'shinken')
  • group (Any) (defaults to: 'shinken')
  • modules (Any) (defaults to: [])
  • conf_dir (Any) (defaults to: '/etc/shinken')
  • modules_dir (Any) (defaults to: '/etc/shinken/modules')
  • daemons_dir (Any) (defaults to: '/etc/shinken/daemons')


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'manifests/init.pp', line 38

class shinken (
  $ensure      = 'present',
  $user        = 'shinken',
  $group       = 'shinken',
  $modules     = [],
  $conf_dir    = '/etc/shinken',
  $modules_dir = '/etc/shinken/modules',
  $daemons_dir = '/etc/shinken/daemons',
) {

  validate_string($user)
  validate_string($group)
  validate_array($modules)

  if ($ensure in ['present', true]) {
    class { 'shinken::users': }->
    class { 'shinken::dirs': }->
    class { 'shinken::install': }->
    class { 'shinken::files': }->
    class { 'shinken::service': }
  } elsif ($ensure in ['absent', false]) {
    class { 'shinken::service':
      ensure => absent,
    }
    class { 'shinken::install':
      ensure => absent,
    }
    class { 'shinken::files':
      ensure => absent,
    }
    class { 'shinken::dirs':
      ensure => absent,
    }
    class { 'shinken::users':
      ensure => absent,
    }
  } else {
    notify{"Parameter ensure => ${ensure} is not managed.":}
  }

}