Puppet Class: sensuclassic::enterprise

Defined in:
manifests/enterprise.pp

Summary

Installs the Sensu packages

Overview

Installs Sensu enterprise

Parameters:

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

    The handler to use when deregistering a client on stop.

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

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

  • gem_path (Optional[String]) (defaults to: $sensuclassic::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: $sensuclassic::init_stop_max_wait)

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

  • log_dir (Optional[String]) (defaults to: $sensuclassic::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: $sensuclassic::log_level)

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

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

    Used to set PATH in /etc/default/sensu

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

    Ruby opts to be passed to the sensu services

  • use_embedded_ruby (Optional[Boolean]) (defaults to: $sensuclassic::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: $sensuclassic::heap_size)

    Value of the HEAP_SIZE environment variable.

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

    Value of the MAX_OPEN_FILES environment variable.

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

    Value of the HEAP_DUMP_PATH environment variable.

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

    Value of the JAVA_OPTS environment variable.

  • hasrestart (Boolean) (defaults to: $sensuclassic::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
101
102
103
104
105
106
107
# File 'manifests/enterprise.pp', line 37

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

  # Package
  if $sensuclassic::enterprise {

    package { 'sensu-enterprise':
      ensure  => $sensuclassic::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 $sensuclassic::manage_services and $sensuclassic::enterprise {

    case $sensuclassic::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'],
          Sensuclassic_api_config[$::fqdn],
          Class['sensuclassic::redis::config'],
          Class['sensuclassic::rabbitmq::config'],
          Class['sensuclassic::package'],
        ],
      }

      exec { 'sensu-enterprise-reload':
        path        => '/usr/bin:/bin:/usr/sbin:/sbin',
        command     => 'service sensu-enterprise reload',
        refreshonly => true,
        require     => Service['sensu-enterprise'],
      }
    }
  }
}