diff --git a/manifests/proxy/formpost.pp b/manifests/proxy/formpost.pp new file mode 100644 index 00000000..42bd1e63 --- /dev/null +++ b/manifests/proxy/formpost.pp @@ -0,0 +1,27 @@ +# +# Configure swift cache_errors. +# +# == Dependencies +# +# == Examples +# +# include 'swift::proxy::formpost' +# +# == Authors +# +# Mehdi Abaakouk +# +# == 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', + } + +} diff --git a/manifests/proxy/staticweb.pp b/manifests/proxy/staticweb.pp new file mode 100644 index 00000000..ad588f78 --- /dev/null +++ b/manifests/proxy/staticweb.pp @@ -0,0 +1,27 @@ +# +# Configure swift cache_errors. +# +# == Dependencies +# +# == Examples +# +# include 'swift::proxy::staticweb' +# +# == Authors +# +# Mehdi Abaakouk +# +# == 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', + } + +} diff --git a/manifests/proxy/tempurl.pp b/manifests/proxy/tempurl.pp new file mode 100644 index 00000000..06152210 --- /dev/null +++ b/manifests/proxy/tempurl.pp @@ -0,0 +1,27 @@ +# +# Configure swift cache_errors. +# +# == Dependencies +# +# == Examples +# +# include 'swift::proxy::tempurl' +# +# == Authors +# +# Mehdi Abaakouk +# +# == 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', + } + +} diff --git a/spec/classes/swift_proxy_formpost_spec.rb b/spec/classes/swift_proxy_formpost_spec.rb new file mode 100644 index 00000000..caadff8d --- /dev/null +++ b/spec/classes/swift_proxy_formpost_spec.rb @@ -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 diff --git a/spec/classes/swift_proxy_staticweb_spec.rb b/spec/classes/swift_proxy_staticweb_spec.rb new file mode 100644 index 00000000..b7f2c353 --- /dev/null +++ b/spec/classes/swift_proxy_staticweb_spec.rb @@ -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 diff --git a/spec/classes/swift_proxy_tempurl_spec.rb b/spec/classes/swift_proxy_tempurl_spec.rb new file mode 100644 index 00000000..87eac0de --- /dev/null +++ b/spec/classes/swift_proxy_tempurl_spec.rb @@ -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 diff --git a/templates/proxy/formpost.conf.erb b/templates/proxy/formpost.conf.erb new file mode 100644 index 00000000..36077166 --- /dev/null +++ b/templates/proxy/formpost.conf.erb @@ -0,0 +1,4 @@ + +[filter:formpost] +use = egg:swift#formpost + diff --git a/templates/proxy/staticweb.conf.erb b/templates/proxy/staticweb.conf.erb new file mode 100644 index 00000000..1e31cb18 --- /dev/null +++ b/templates/proxy/staticweb.conf.erb @@ -0,0 +1,4 @@ + +[filter:staticweb] +use = egg:swift#staticweb + diff --git a/templates/proxy/tempurl.conf.erb b/templates/proxy/tempurl.conf.erb new file mode 100644 index 00000000..4d0219a5 --- /dev/null +++ b/templates/proxy/tempurl.conf.erb @@ -0,0 +1,4 @@ + +[filter:tempurl] +use = egg:swift#tempurl +