puppet-aodh/manifests/listener.pp
ZhongShengping cb865e6e5b Add hooks for external install & svc management
This adds defined anchor points for external modules to hook into the
software install, config and service dependency chain.  This allows
external modules to manage software installation (virtualenv,
containers, etc) and service management (pacemaker) without needing rely
on resources that may change or be renamed.

Change-Id: Ibc184a50cf16b7048e0f7249f8894d8661bb76fe
2016-11-28 13:13:17 +08:00

47 lines
1.0 KiB
Puppet

# Installs the aodh listener 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.
#
# [*package_ensure*]
# (optional) ensure state for package.
# Defaults to 'present'
#
class aodh::listener (
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
) {
include ::aodh::deps
include ::aodh::params
ensure_resource( 'package', [$::aodh::params::listener_package_name],
{ ensure => $package_ensure,
tag => ['openstack', 'aodh-package'] }
)
if $manage_service {
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
}
service { 'aodh-listener':
ensure => $service_ensure,
name => $::aodh::params::listener_service_name,
enable => $enabled,
hasstatus => true,
hasrestart => true,
tag => 'aodh-service',
}
}