set url_base option in staticweb swift middleware

the url_base option was recently added upstream to resolve
issue with SSL termination by haproxy.

Closes-Bug: 1638632

Change-Id: Icf45cf2aece398b836c87ddffde5d3056e96dc4d
Signed-off-by: Thiago da Silva <thiago@redhat.com>
This commit is contained in:
Thiago da Silva 2016-11-02 14:08:27 -04:00
parent 49a4be7277
commit 239a8e592c
2 changed files with 19 additions and 1 deletions

View File

@ -8,6 +8,12 @@
#
# include 'swift::proxy::staticweb'
#
# == Parameters
#
# [*url_base*]
# (optional) The URL scheme and/or the host name used to generate redirects.
# Defaults to $::os_service_default.
#
# == Authors
#
# Mehdi Abaakouk <sileht@sileht.net>
@ -16,11 +22,14 @@
#
# Copyright 2012 eNovance licensing@enovance.com
#
class swift::proxy::staticweb() {
class swift::proxy::staticweb(
$url_base = $::os_service_default
) {
include ::swift::deps
swift_proxy_config {
'filter:staticweb/use': value => 'egg:swift#staticweb';
'filter:staticweb/url_base': value => $url_base;
}
}

View File

@ -8,4 +8,13 @@ describe 'swift::proxy::staticweb' do
it { is_expected.to contain_swift_proxy_config('filter:staticweb/use').with_value('egg:swift#staticweb') }
describe "when overriding default parameters" do
let :params do
{
:url_base => 'https://www.example.com',
}
end
it { is_expected.to contain_swift_proxy_config('filter:staticweb/url_base').with_value('https://www.example.com') }
end
end