Expand supported storage middlewares

This commit expands the supported storage
middlewares to include:
  - healthcheck - used to be able to perform
healthchecks on a storage node
  - recon
This commit is contained in:
François Charlier 2012-06-04 13:19:51 -07:00 committed by Dan Bode
parent 48966fc507
commit 106396a9ff
5 changed files with 144 additions and 0 deletions

View File

@ -0,0 +1,26 @@
#
# Configure swift healthcheck.
#
# == Dependencies
#
# == Examples
#
# == Authors
#
# Dan Bode dan@puppetlabs.com
# François Charlier fcharlier@ploup.net
#
# == Copyright
#
# Copyright 2011 Puppetlabs Inc, unless otherwise noted.
#
define swift::storage::filter::healthcheck(
) {
concat::fragment { "swift_healthcheck_${name}":
target => "/etc/swift/${name}-server.conf",
content => template('swift/proxy/healthcheck.conf.erb'),
order => '25',
}
}

View File

@ -0,0 +1,31 @@
#
# Configure swift recon.
#
# == Parameters
# [cache_path] The path for recon cache
# Optional. Defaults to '/var/cache/swift/'
#
# == Dependencies
#
# == Examples
#
# == Authors
#
# Dan Bode dan@puppetlabs.com
# François Charlier fcharlier@ploup.net
#
# == Copyright
#
# Copyright 2011 Puppetlabs Inc, unless otherwise noted.
#
define swift::storage::filter::recon(
$cache_path = '/var/cache/swift'
) {
concat::fragment { "swift_recon_${name}":
target => "/etc/swift/${name}-server.conf",
content => template('swift/recon.conf.erb'),
order => '35',
}
}

View File

@ -0,0 +1,32 @@
require 'spec_helper'
describe 'swift::storage::filter::healthcheck' do
let :title do
'dummy'
end
let :facts do
{
:concat_basedir => '/var/lib/puppet/concat'
}
end
let :pre_condition do
'class { "concat::setup": }
concat { "/etc/swift/dummy-server.conf": }'
end
let :fragment_file do
"/var/lib/puppet/concat/_etc_swift_dummy-server.conf/fragments/25_swift_healthcheck_dummy"
end
it 'should build the fragment with correct content' do
verify_contents(subject, fragment_file,
[
'[filter:healthcheck]',
'use = egg:swift#healthcheck'
]
)
end
end

View File

@ -0,0 +1,52 @@
require 'spec_helper'
describe 'swift::storage::filter::recon' do
let :title do
'dummy'
end
let :facts do
{
:concat_basedir => '/var/lib/puppet/concat'
}
end
let :pre_condition do
'class { "concat::setup": }
concat { "/etc/swift/dummy-server.conf": }'
end
let :fragment_file do
"/var/lib/puppet/concat/_etc_swift_dummy-server.conf/fragments/35_swift_recon_dummy"
end
describe 'when passing default parameters' do
it 'should build the fragment with correct content' do
verify_contents(subject, fragment_file,
[
'[filter:recon]',
'use = egg:swift#recon',
'recon_cache_path = /var/cache/swift'
]
)
end
end
describe 'when overriding default parameters' do
let :params do
{
:cache_path => '/some/other/path'
}
end
it 'should build the fragment with correct content' do
verify_contents(subject, fragment_file,
[
'[filter:recon]',
'use = egg:swift#recon',
'recon_cache_path = /some/other/path'
]
)
end
end
end

View File

@ -0,0 +1,3 @@
[filter:recon]
use = egg:swift#recon
recon_cache_path = <%= cache_path %>