Add the ceilometer middleware

Change-Id: Ibcdaa1218c8d027dc3e4b6d2cd394e9d0af8c6da
This commit is contained in:
François Charlier 2013-02-25 19:51:59 +01:00 committed by Mehdi Abaakouk
parent 9a3a0b7c24
commit 015be53c81
3 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,35 @@
#
# Configure ceilometer middleware for swift
#
# == Dependencies
#
# puppet-ceilometer (http://github.com/enovance/puppet-ceilometer)
#
# == Examples
#
# == Authors
#
# Francois Charlier fcharlier@enovance.com
#
# == Copyright
#
# Copyright 2013 eNovance licensing@enovance.com
#
class swift::proxy::ceilometer(
$ensure = 'present'
) inherits swift {
include $::swift::params
User['swift'] {
groups +> 'ceilometer',
}
concat::fragment { 'swift_ceilometer':
target => '/etc/swift/proxy-server.conf',
content => template('swift/proxy/ceilometer.conf.erb'),
order => '33',
require => Class['::ceilometer']
}
}

View File

@ -0,0 +1,30 @@
require 'spec_helper'
describe 'swift::proxy::ceilometer' do
let :facts do
{
:concat_basedir => '/var/lib/puppet/concat',
:osfamily => 'Debian'
}
end
let :pre_condition do
'class { "concat::setup": }
concat { "/etc/swift/proxy-server.conf": }
class { "ssh::server::install": }
class { "swift":
swift_hash_suffix => "dummy"
}'
end
let :fragment_file do
"/var/lib/puppet/concat/_etc_swift_proxy-server.conf/fragments/33_swift_ceilometer"
end
it { should contain_file(fragment_file).with_content(/[filter:ceilometer]/) }
it { should contain_file(fragment_file).with_content(/use = egg:ceilometer#swift/) }
it { should contain_concat__fragment('swift_ceilometer').with_require('Class[::Ceilometer]') }
it { should contain_user('swift').with_groups('ceilometer') }
end

View File

@ -0,0 +1,3 @@
[filter:ceilometer]
use = egg:ceilometer#swift