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:
parent
48966fc507
commit
106396a9ff
@ -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',
|
||||
}
|
||||
|
||||
}
|
31
deployment/puppet/swift/manifests/storage/filter/recon.pp
Normal file
31
deployment/puppet/swift/manifests/storage/filter/recon.pp
Normal 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',
|
||||
}
|
||||
|
||||
}
|
@ -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
|
@ -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
|
3
deployment/puppet/swift/templates/recon.conf.erb
Normal file
3
deployment/puppet/swift/templates/recon.conf.erb
Normal file
@ -0,0 +1,3 @@
|
||||
[filter:recon]
|
||||
use = egg:swift#recon
|
||||
recon_cache_path = <%= cache_path %>
|
Loading…
Reference in New Issue
Block a user