Add the ceilometer middleware
Change-Id: Ibcdaa1218c8d027dc3e4b6d2cd394e9d0af8c6da
This commit is contained in:
parent
9a3a0b7c24
commit
015be53c81
35
manifests/proxy/ceilometer.pp
Normal file
35
manifests/proxy/ceilometer.pp
Normal 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']
|
||||
}
|
||||
|
||||
}
|
30
spec/classes/swift_proxy_ceilometer_spec.rb
Normal file
30
spec/classes/swift_proxy_ceilometer_spec.rb
Normal 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
|
3
templates/proxy/ceilometer.conf.erb
Normal file
3
templates/proxy/ceilometer.conf.erb
Normal file
@ -0,0 +1,3 @@
|
||||
[filter:ceilometer]
|
||||
use = egg:ceilometer#swift
|
||||
|
Loading…
Reference in New Issue
Block a user