Puppet Class: ceilometer::alarm::evaluator

Defined in:
manifests/alarm/evaluator.pp

Overview

Installs the ceilometer alarm evaluator service

Params

[*enabled*]
  (optional) Should the service be enabled.
  Defaults to true.

[*manage_service*]
  (optional) Whether the service should be managed by Puppet.
  Defaults to true.

[*evaluation_interval*]
  (optional) Define the time interval for the alarm evaluator
  Defaults to 60.

[*evaluation_service*]
  (optional) Define which service use for the evaluator
  Defaults to 'ceilometer.alarm.service.SingletonAlarmService'.

[*partition_rpc_topic*]
  (optional) Define which topic the alarm evaluator should access
  Defaults to 'alarm_partition_coordination'.

[*record_history*]
  (optional) Record alarm change events
  Defaults to true.

[*coordination_url*]
  (optional) The url to use for distributed group membership coordination.
  Defaults to undef.

Parameters:

  • manage_service (Any) (defaults to: true)
  • enabled (Any) (defaults to: true)
  • evaluation_interval (Any) (defaults to: 60)
  • evaluation_service (Any) (defaults to: 'ceilometer.alarm.service.SingletonAlarmService')
  • partition_rpc_topic (Any) (defaults to: 'alarm_partition_coordination')
  • record_history (Any) (defaults to: true)
  • coordination_url (Any) (defaults to: undef)


32
33
34
35
36
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
# File 'manifests/alarm/evaluator.pp', line 32

class ceilometer::alarm::evaluator (
  $manage_service      = true,
  $enabled             = true,
  $evaluation_interval = 60,
  $evaluation_service  = 'ceilometer.alarm.service.SingletonAlarmService',
  $partition_rpc_topic = 'alarm_partition_coordination',
  $record_history      = true,
  $coordination_url    = undef,
) {

  include ceilometer::params

  validate_re("${evaluation_interval}",'^(\d+)$')

  Ceilometer_config<||> ~> Service['ceilometer-alarm-evaluator']

  Package[$::ceilometer::params::alarm_package_name] -> Service['ceilometer-alarm-evaluator']
  Package[$::ceilometer::params::alarm_package_name] -> Package<| title == 'ceilometer-alarm' |>
  ensure_packages($::ceilometer::params::alarm_package_name)

  if $manage_service {
    if $enabled {
      $service_ensure = 'running'
    } else {
      $service_ensure = 'stopped'
    }
  }

  Package['ceilometer-common'] -> Service['ceilometer-alarm-evaluator']

  service { 'ceilometer-alarm-evaluator':
    ensure     => $service_ensure,
    name       => $::ceilometer::params::alarm_evaluator_service_name,
    enable     => $enabled,
    hasstatus  => true,
    hasrestart => true
  }

  ceilometer_config {
    'alarm/evaluation_interval' :  value => $evaluation_interval;
    'alarm/evaluation_service'  :  value => $evaluation_service;
    'alarm/partition_rpc_topic' :  value => $partition_rpc_topic;
    'alarm/record_history'      :  value => $record_history;
  }

  if $coordination_url {
    ensure_resource('ceilometer_config', 'coordination/backend_url',
      {'value' => $coordination_url})
  }
}