From 239a8e592cbda00ee1ea55606aedaa313c232713 Mon Sep 17 00:00:00 2001 From: Thiago da Silva Date: Wed, 2 Nov 2016 14:08:27 -0400 Subject: [PATCH] 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 --- manifests/proxy/staticweb.pp | 11 ++++++++++- spec/classes/swift_proxy_staticweb_spec.rb | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/manifests/proxy/staticweb.pp b/manifests/proxy/staticweb.pp index ac8c5dbd..d85e5b60 100644 --- a/manifests/proxy/staticweb.pp +++ b/manifests/proxy/staticweb.pp @@ -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 @@ -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; } } diff --git a/spec/classes/swift_proxy_staticweb_spec.rb b/spec/classes/swift_proxy_staticweb_spec.rb index 78e1fc3d..f5a86981 100644 --- a/spec/classes/swift_proxy_staticweb_spec.rb +++ b/spec/classes/swift_proxy_staticweb_spec.rb @@ -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