Puppet Class: sensu::enterprise

Defined in:
manifests/enterprise.pp

Summary

Installs the Sensu packages

Overview

Installs Sensu enterprise

Parameters:

  • deregister_handler (Optional[String]) (defaults to: $::sensu::deregister_handler)

    The handler to use when deregistering a client on stop.

  • deregister_on_stop (Optional[Boolean]) (defaults to: $::sensu::deregister_on_stop)

    Whether the sensu client should deregister from the API on service stop

  • gem_path (Optional[String]) (defaults to: $::sensu::gem_path)

    Paths to add to GEM_PATH if we need to look for different dirs.

  • init_stop_max_wait (Variant[Undef,Integer,Pattern[/^(\d+)$/]]) (defaults to: $::sensu::init_stop_max_wait)

    Number of seconds to wait for the init stop script to run

  • log_dir (Optional[String]) (defaults to: $::sensu::log_dir)

    Sensu log directory to be used Valid values: Any valid log directory path, accessible by the sensu user

  • log_level (Optional[String]) (defaults to: $::sensu::log_level)

    Sensu log level to be used Valid values: debug, info, warn, error, fatal

  • path (Optional[String]) (defaults to: $::sensu::path)

    Used to set PATH in /etc/default/sensu

  • rubyopt (Optional[String]) (defaults to: $::sensu::rubyopt)

    Ruby opts to be passed to the sensu services

  • use_embedded_ruby (Optional[Boolean]) (defaults to: $::sensu::use_embedded_ruby)

    If the embedded ruby should be used, e.g. to install the sensu-plugin gem. This value is overridden by a defined sensu_plugin_provider. Note, the embedded ruby should always be used to provide full compatibility. Using other ruby runtimes, e.g. the system ruby, is not recommended.

  • heap_size (Variant[Undef,Integer,Pattern[/^(\d+)/]]) (defaults to: $::sensu::heap_size)

    Value of the HEAP_SIZE environment variable.

  • max_open_files (Variant[Undef,Integer,Pattern[/^(\d+)$/]]) (defaults to: $::sensu::max_open_files)

    Value of the MAX_OPEN_FILES environment variable.

  • heap_dump_path (Variant[Undef,String]) (defaults to: $::sensu::heap_dump_path)

    Value of the HEAP_DUMP_PATH environment variable.

  • java_opts (Variant[Undef,String]) (defaults to: $::sensu::java_opts)

    Value of the JAVA_OPTS environment variable.

  • hasrestart (Boolean) (defaults to: $::sensu::hasrestart)


37
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'manifests/enterprise.pp', line 37

class sensu::enterprise (
  Optional[String]  $deregister_handler = $::sensu::deregister_handler,
  Optional[Boolean] $deregister_on_stop = $::sensu::deregister_on_stop,
  Optional[String]  $gem_path           = $::sensu::gem_path,
  Variant[Undef,Integer,Pattern[/^(\d+)$/]] $init_stop_max_wait = $::sensu::init_stop_max_wait,
  Optional[String]  $log_dir            = $::sensu::log_dir,
  Optional[String]  $log_level          = $::sensu::log_level,
  Optional[String]  $path               = $::sensu::path,
  Optional[String]  $rubyopt            = $::sensu::rubyopt,
  Optional[Boolean] $use_embedded_ruby  = $::sensu::use_embedded_ruby,
  Variant[Undef,Integer,Pattern[/^(\d+)/]] $heap_size = $::sensu::heap_size,
  Variant[Undef,Integer,Pattern[/^(\d+)$/]] $max_open_files = $::sensu::max_open_files,
  Variant[Undef,String] $heap_dump_path = $::sensu::heap_dump_path,
  Variant[Undef,String] $java_opts      = $::sensu::java_opts,
  Boolean $hasrestart                   = $::sensu::hasrestart,
) {

  # Package
  if $::sensu::enterprise {

    package { 'sensu-enterprise':
      ensure  => $::sensu::enterprise_version,
    }

    file { '/etc/default/sensu-enterprise':
      ensure  => file,
      content => template("${module_name}/sensu-enterprise.erb"),
      owner   => '0',
      group   => '0',
      mode    => '0444',
      require => Package['sensu-enterprise'],
    }
  }

  # Service
  if $::sensu::manage_services and $::sensu::enterprise {

    case $::sensu::enterprise {
      true: {
        $ensure = 'running'
        $enable = true
      }
      default: {
        $ensure = 'stopped'
        $enable = false
      }
    }

    if $::osfamily != 'windows' {
      service { 'sensu-enterprise':
        ensure     => $ensure,
        enable     => $enable,
        hasrestart => $hasrestart,
        subscribe  => [
          File['/etc/default/sensu-enterprise'],
          Sensu_api_config[$::fqdn],
          Class['sensu::redis::config'],
          Class['sensu::rabbitmq::config'],
          Class['sensu::package'],
        ],
      }
    }
  }
}