Add some middlewares (tempurl, staticweb, formpost)

This commit is contained in:
Mehdi Abaakouk 2012-11-16 15:38:07 +01:00
parent 995ec33b13
commit 3ac424cc42
9 changed files with 162 additions and 0 deletions

@ -0,0 +1,27 @@
#
# Configure swift cache_errors.
#
# == Dependencies
#
# == Examples
#
# include 'swift::proxy::formpost'
#
# == Authors
#
# Mehdi Abaakouk <sileht@sileht.net>
#
# == Copyright
#
# Copyright 2012 eNovance licensing@enovance.com
#
class swift::proxy::formpost() {
concat::fragment { 'swift-proxy-formpost':
target => '/etc/swift/proxy-server.conf',
content => template('swift/proxy/formpost.conf.erb'),
order => '31',
}
}

@ -0,0 +1,27 @@
#
# Configure swift cache_errors.
#
# == Dependencies
#
# == Examples
#
# include 'swift::proxy::staticweb'
#
# == Authors
#
# Mehdi Abaakouk <sileht@sileht.net>
#
# == Copyright
#
# Copyright 2012 eNovance licensing@enovance.com
#
class swift::proxy::staticweb() {
concat::fragment { 'swift-proxy-staticweb':
target => '/etc/swift/proxy-server.conf',
content => template('swift/proxy/staticweb.conf.erb'),
order => '32',
}
}

@ -0,0 +1,27 @@
#
# Configure swift cache_errors.
#
# == Dependencies
#
# == Examples
#
# include 'swift::proxy::tempurl'
#
# == Authors
#
# Mehdi Abaakouk <sileht@sileht.net>
#
# == Copyright
#
# Copyright 2012 eNovance licensing@enovance.com
#
class swift::proxy::tempurl() {
concat::fragment { 'swift-proxy-tempurl':
target => '/etc/swift/proxy-server.conf',
content => template('swift/proxy/tempurl.conf.erb'),
order => '29',
}
}

@ -0,0 +1,23 @@
require 'spec_helper'
describe 'swift::proxy::formpost' do
let :facts do
{
:concat_basedir => '/var/lib/puppet/concat'
}
end
let :pre_condition do
'class { "concat::setup": }
concat { "/etc/swift/proxy-server.conf": }'
end
let :fragment_file do
"/var/lib/puppet/concat/_etc_swift_proxy-server.conf/fragments/31_swift-proxy-formpost"
end
it { should contain_file(fragment_file).with_content(/[filter:formpost]/) }
it { should contain_file(fragment_file).with_content(/use = egg:swift#formpost/) }
end

@ -0,0 +1,23 @@
require 'spec_helper'
describe 'swift::proxy::staticweb' do
let :facts do
{
:concat_basedir => '/var/lib/puppet/concat'
}
end
let :pre_condition do
'class { "concat::setup": }
concat { "/etc/swift/proxy-server.conf": }'
end
let :fragment_file do
"/var/lib/puppet/concat/_etc_swift_proxy-server.conf/fragments/32_swift-proxy-staticweb"
end
it { should contain_file(fragment_file).with_content(/[filter:staticweb]/) }
it { should contain_file(fragment_file).with_content(/use = egg:swift#staticweb/) }
end

@ -0,0 +1,23 @@
require 'spec_helper'
describe 'swift::proxy::tempurl' do
let :facts do
{
:concat_basedir => '/var/lib/puppet/concat'
}
end
let :pre_condition do
'class { "concat::setup": }
concat { "/etc/swift/proxy-server.conf": }'
end
let :fragment_file do
"/var/lib/puppet/concat/_etc_swift_proxy-server.conf/fragments/29_swift-proxy-tempurl"
end
it { should contain_file(fragment_file).with_content(/[filter:tempurl]/) }
it { should contain_file(fragment_file).with_content(/use = egg:swift#tempurl/) }
end

@ -0,0 +1,4 @@
[filter:formpost]
use = egg:swift#formpost

@ -0,0 +1,4 @@
[filter:staticweb]
use = egg:swift#staticweb

@ -0,0 +1,4 @@
[filter:tempurl]
use = egg:swift#tempurl