fuel-plugin-lma-collector/deployment_scripts/puppet/manifests/cinder.pp
Simon Pasquier 3f0cdd5061 Clean-up resources dealing with notifications
This change refactors the lma_collector Puppet module regarding the
processing of the OpenStack notifications to get rid of the coupling with
Fuel. In particular, the configuration of the OpenStack services is
done in the external manifests since there was no point to have it in
lma_collector.

The change removes also workarounds that were necessary with older
versions of the plugin:

  - heat-engine is now managed as a regular service.
  - the can_exit flag is reverted back to false for the AMQP plugins

Finally it restarts properly the Keystone service if necessary:
Keystone is executed as a WSGI application in Apache so we need to
restart Apache if the Keystone configuration changes.

Change-Id: I39a2d25695449271b946ddcbca00cd8911dbdbb4
Implements: blueprint lma-without-fuel
2016-02-04 09:36:02 +01:00

66 lines
1.9 KiB
Puppet

# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
include lma_collector::params
$ceilometer = hiera_hash('ceilometer', {})
$lma_collector = hiera_hash('lma_collector')
$roles = node_roles(hiera('nodes'), hiera('uid'))
$is_controller = member($roles, 'controller') or member($roles, 'primary-controller')
if $is_controller {
# On controllers make sure the LMA service is configured
# with the "pacemaker" provider
include lma_collector::params
Service<| title == $lma_collector::params::service_name |> {
provider => 'pacemaker'
}
}
if $lma_collector['influxdb_mode'] != 'disabled' {
class { 'lma_collector::logs::counter':
hostname => $::hostname,
}
}
if $lma_collector['elasticsearch_mode'] != 'disabled' {
lma_collector::logs::openstack { 'cinder': }
}
if $ceilometer['enabled'] {
$notification_topics = ['notifications', 'lma_notifications']
}
else {
$notification_topics = ['lma_notifications']
}
# OpenStack notifcations are always useful for indexation and metrics collection
include cinder::params
$volume_service = $::cinder::params::volume_service
cinder_config { 'DEFAULT/notification_topics':
value => join($notification_topics, ','),
notify => Service[$volume_service],
}
cinder_config { 'DEFAULT/notification_driver':
value => $driver,
notify => Service[$volume_service],
}
service { $volume_service:
hasstatus => true,
hasrestart => true,
}