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