Skip to content

Commit

Permalink
Merge "Add manage_service feature"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Sep 29, 2014
2 parents b9dd42d + 10d38bd commit 7e512f8
Show file tree
Hide file tree
Showing 14 changed files with 402 additions and 138 deletions.
20 changes: 14 additions & 6 deletions manifests/agent/central.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
#
# == Parameters
# [*enabled*]
# Should the service be enabled. Optional. Defauls to true
# (optional) Should the service be enabled.
# Defaults to true.
#
# [*manage_service*]
# (optional) Whether the service should be managed by Puppet.
# Defaults to true.
#
class ceilometer::agent::central (
$enabled = true,
$manage_service = true,
$enabled = true,
) {

include ceilometer::params
Expand All @@ -18,10 +24,12 @@
name => $::ceilometer::params::agent_central_package_name,
}

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

Package['ceilometer-common'] -> Service['ceilometer-agent-central']
Expand Down
21 changes: 14 additions & 7 deletions manifests/agent/compute.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
#
# == Parameters
# [*enabled*]
# should the service be started or not
# Optional. Defaults to true
# (optional) Should the service be enabled.
# Defaults to true.
#
# [*manage_service*]
# (optional) Whether the service should be managed by Puppet.
# Defaults to true.
#
class ceilometer::agent::compute (
$enabled = true,
$manage_service = true,
$enabled = true,
) inherits ceilometer {

include ceilometer::params
Expand All @@ -30,10 +35,12 @@
}
}

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

Package['ceilometer-common'] -> Service['ceilometer-agent-compute']
Expand Down
20 changes: 13 additions & 7 deletions manifests/agent/notification.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@
# file with the OVS plugin if both are on the same machine.
#
# === Parameters
#
# [*enabled*]
# (optional) Should the service be started or not
# Defaults to true
# (optional) Should the service be enabled.
# Defaults to true.
#
# [*manage_service*]
# (optional) Whether the service should be managed by Puppet.
# Defaults to true.
#
# [*ack_on_event_error*]
# (optional) Acknowledge message when event persistence fails.
Expand All @@ -38,6 +41,7 @@
#

class ceilometer::agent::notification (
$manage_service = true,
$enabled = true,
$ack_on_event_error = true,
$store_events = false
Expand All @@ -50,10 +54,12 @@
Package[$::ceilometer::params::agent_notification_package_name] -> Service['ceilometer-agent-notification']
ensure_packages([$::ceilometer::params::agent_notification_package_name])

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

Package['ceilometer-common'] -> Service['ceilometer-agent-notification']
Expand Down
36 changes: 26 additions & 10 deletions manifests/alarm/evaluator.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,32 @@
#
# == Params
# [*enabled*]
# should the service be 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*]
# define the time interval for the alarm evaluator
# (optional) Define the time interval for the alarm evaluator
# Defaults to 60.
#
# [*evaluation_service*]
# define which service use for the evaluator
# (optional) Define which service use for the evaluator
# Defaults to 'ceilometer.alarm.service.SingletonAlarmService'.
#
# [*partition_rpc_topic*]
# define which topic the alarm evaluator should access
# (optional) Define which topic the alarm evaluator should access
# Defaults to 'alarm_partition_coordination'.
#
# [*record_history*]
# Record alarm change events
# (optional) Record alarm change events
# Defaults to true.
#
class ceilometer::alarm::evaluator (
$enabled = true,
$manage_service = true,
$enabled = true,
$evaluation_interval = 60,
$evaluation_service = 'ceilometer.alarm.service.SingletonAlarmService',
$partition_rpc_topic = 'alarm_partition_coordination',
Expand All @@ -30,10 +44,12 @@
Package[$::ceilometer::params::alarm_package_name] -> Package<| title == 'ceilometer-alarm' |>
ensure_packages($::ceilometer::params::alarm_package_name)

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

Package['ceilometer-common'] -> Service['ceilometer-alarm-evaluator']
Expand Down
35 changes: 25 additions & 10 deletions manifests/alarm/notifier.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,31 @@
#
# == Params
# [*enabled*]
# should the service be enabled
# (optional) Should the service be enabled.
# Defaults to true.
#
# [*manage_service*]
# (optional) Whether the service should be managed by Puppet.
# Defaults to true.
#
# [*notifier_rpc_topic*]
# define on which topic the notifier will have
# access
# (optional) Define on which topic the notifier will have access.
# Defaults to undef.
#
# [*rest_notifier_certificate_key*]
# define the certificate key for the rest service
# (optional) Define the certificate key for the rest service.
# Defaults to undef.
#
# [*rest_notifier_certificate_file*]
# define the certificate file for the rest service
# (optional) Define the certificate file for the rest service.
# Defaults to undef.
#
# [*rest_notifier_ssl_verify*]
# should the ssl verify parameter be enabled
# (optional) Should the ssl verify parameter be enabled.
# Defaults to true.
#
class ceilometer::alarm::notifier (
$manage_service = true,
$enabled = true,
$notifier_rpc_topic = undef,
$rest_notifier_certificate_key = undef,
Expand All @@ -31,10 +44,12 @@
Package[$::ceilometer::params::alarm_package_name] -> Package<| title == 'ceilometer-alarm' |>
ensure_packages($::ceilometer::params::alarm_package_name)

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

Package['ceilometer-common'] -> Service['ceilometer-alarm-notifier']
Expand Down
57 changes: 36 additions & 21 deletions manifests/api.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,54 @@
#
# == Parameters
# [*enabled*]
# should the service be enabled. Optional. Defaults to true
# (optional) Should the service be enabled.
# Defaults to true
#
# [*manage_service*]
# (optional) Whether the service should be managed by Puppet.
# Defaults to true.
#
# [*keystone_host*]
# keystone's admin endpoint IP/Host. Optional. Defaults to 127.0.0.1
# (optional) Keystone's admin endpoint IP/Host.
# Defaults to '127.0.0.1'
#
# [*keystone_port*]
# keystone's admin endpoint port. Optional. Defaults to 35357
# (optional) Keystone's admin endpoint port.
# Defaults to 35357
#
# [*keystone_auth_admin_prefix*]
# 'path' to the keystone admin endpoint. Optional. Defaults to false (empty)
# (optional) 'path' to the keystone admin endpoint.
# Define to a path starting with a '/' and without trailing '/'.
# Eg.: '/keystone/admin' to match keystone::wsgi::apache default.
# Defaults to false (empty)
#
# [*keystone_protocol*] http/https
# Optional. Defaults to https
# [*keystone_protocol*]
# (optional) 'http' or 'https'
# Defaults to 'https'.
#
# [*keytone_user*] user to authenticate with
# Optional. Defaults to ceilometer
# [*keytone_user*]
# (optional) User to authenticate with.
# Defaults to 'ceilometer'.
#
# [*keystone_tenant*] tenant to authenticate with
# Optional. Defaults to services
# [*keystone_tenant*]
# (optional) Tenant to authenticate with.
# Defaults to 'services'.
#
# [*keystone_password*] password to authenticate with
# [*keystone_password*]
# Password to authenticate with.
# Mandatory.
#
# [*host*]
# (optional) The ceilometer api bind address
# Defaults to 0.0.0.0
# [*host*]
# (optional) The ceilometer api bind address.
# Defaults to 0.0.0.0
#
# [*port*]
# (optional) The ceilometer api port
# Defaults to 8777
# [*port*]
# (optional) The ceilometer api port.
# Defaults to 8777
#

class ceilometer::api (
$manage_service = true,
$enabled = true,
$keystone_host = '127.0.0.1',
$keystone_port = '35357',
Expand All @@ -63,10 +76,12 @@
name => $::ceilometer::params::api_package_name,
}

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

Package['ceilometer-common'] -> Service['ceilometer-api']
Expand Down
24 changes: 16 additions & 8 deletions manifests/collector.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
#
# == Params
# [*enabled*]
# should the service be enabled
# (optional) Should the service be enabled.
# Defaults to true.
#
# [*manage_service*]
# (optional) Whether the service should be managed by Puppet.
# Defaults to true.
#
class ceilometer::collector (
$enabled = true,
$manage_service = true,
$enabled = true,
) {

include ceilometer::params
Expand All @@ -15,12 +21,14 @@
Package[$::ceilometer::params::collector_package_name] -> Service['ceilometer-collector']
ensure_packages([$::ceilometer::params::collector_package_name])

if $enabled {
$service_ensure = 'running'
Class['ceilometer::db'] -> Service['ceilometer-collector']
Exec['ceilometer-dbsync'] ~> Service['ceilometer-collector']
} else {
$service_ensure = 'stopped'
if $manage_service {
if $enabled {
$service_ensure = 'running'
Class['ceilometer::db'] -> Service['ceilometer-collector']
Exec['ceilometer-dbsync'] ~> Service['ceilometer-collector']
} else {
$service_ensure = 'stopped'
}
}

Package['ceilometer-common'] -> Service['ceilometer-collector']
Expand Down
Loading

0 comments on commit 7e512f8

Please sign in to comment.