
Now for using Ceilometer notifications from Swift we should use Ceilometer middleware. Hence we need update template for Swift to account for incoming and outgoing traffic notifications. [1] I686e5d94fb72fd2a00973c91673edc417142ee2f [2] http://docs.openstack.org/developer/oslo.messaging/transport.html#oslo_messaging.TransportURL Change-Id: Ib6efd4a1ab4b76c74cffc546383f5382c24a8c43 Related-bug: #1510064
109 lines
2.5 KiB
Puppet
109 lines
2.5 KiB
Puppet
#
|
|
# Configure ceilometer middleware for swift
|
|
#
|
|
# == Dependencies
|
|
#
|
|
# puppet-ceilometer (http://github.com/enovance/puppet-ceilometer)
|
|
#
|
|
# == Parameters
|
|
#
|
|
# [*rabbit_host*]
|
|
# (Optional) IP or hostname of the rabbit server.
|
|
# Defaults to '127.0.0.1'.
|
|
#
|
|
# [*rabbit_port*]
|
|
# (Optional) Port of the rabbit server.
|
|
# Defaults to 5672.
|
|
#
|
|
# [*rabbit_hosts*]
|
|
# (Optional) IP or hostname of the rabbits servers.
|
|
# comma separated array (ex: ['1.0.0.10:5672','1.0.0.11:5672'])
|
|
# Defaults to undef.
|
|
#
|
|
# [*rabbit_user*]
|
|
# (Optional) Username for rabbit.
|
|
# Defaults to 'guest'.
|
|
#
|
|
# [*rabbit_password*]
|
|
# (Optional) Password for rabbit user.
|
|
# Defaults to 'guest'.
|
|
#
|
|
# [*rabbit_virtual_host*]
|
|
# (Optional) Virtual host to use.
|
|
# Defaults to '/'.
|
|
#
|
|
# [*driver*]
|
|
# (Optional) The Drivers(s) to handle sending notifications.
|
|
# Defaults to undef.
|
|
#
|
|
# [*topic*]
|
|
# (Optional) AMQP topic used for OpenStack notifications.
|
|
# Defaults to undef.
|
|
#
|
|
# [*control_exchange*]
|
|
# (Optional) The default exchange under which topics are scoped.
|
|
# Defaults to undef.
|
|
#
|
|
# [*ensure*]
|
|
# Enable or not ceilometer fragment
|
|
# Defaults to 'present'
|
|
#
|
|
# [*group*]
|
|
# Group name to add to 'swift' user.
|
|
# ceilometer/eventlet: set 'ceilometer' (default)
|
|
# ceilometer/wsgi: set $::apache::group
|
|
# Defaults to 'ceilometer'
|
|
#
|
|
# == Examples
|
|
#
|
|
# == Authors
|
|
#
|
|
# Francois Charlier fcharlier@enovance.com
|
|
#
|
|
# == Copyright
|
|
#
|
|
# Copyright 2013 eNovance licensing@enovance.com
|
|
#
|
|
class swift::proxy::ceilometer(
|
|
$rabbit_user = 'guest',
|
|
$rabbit_password = 'guest',
|
|
$rabbit_host = '127.0.0.1',
|
|
$rabbit_port = '5672',
|
|
$rabbit_hosts = undef,
|
|
$rabbit_virtual_host = '/',
|
|
$driver = undef,
|
|
$topic = undef,
|
|
$control_exchange = undef,
|
|
$ensure = 'present',
|
|
$group = 'ceilometer',
|
|
) inherits swift {
|
|
|
|
User['swift'] {
|
|
groups +> $group,
|
|
}
|
|
|
|
if defined(Service['swift-proxy']) {
|
|
File['/var/log/ceilometer/swift-proxy-server.log'] -> Service['swift-proxy']
|
|
}
|
|
|
|
file { '/var/log/ceilometer/swift-proxy-server.log':
|
|
ensure => file,
|
|
mode => '0664',
|
|
owner => 'swift',
|
|
group => 'swift',
|
|
}
|
|
|
|
concat::fragment { 'swift_ceilometer':
|
|
target => '/etc/swift/proxy-server.conf',
|
|
content => template('swift/proxy/ceilometer.conf.erb'),
|
|
order => '33',
|
|
require => Class['::ceilometer'],
|
|
}
|
|
|
|
package { 'python-ceilometermiddleware':
|
|
ensure => $ensure,
|
|
tag => 'openstack',
|
|
}
|
|
|
|
}
|