dashboard: bring specific vhost flexibility
Signed-off-by: Dimitri Savineau <dimitri.savineau@enovance.com>
This commit is contained in:
parent
773ba6c5da
commit
b11be44ef5
@ -93,6 +93,7 @@ class cloud::dashboard(
|
||||
$ssl_forward = false,
|
||||
$os_endpoint_type = undef,
|
||||
$allowed_hosts = $::fqdn,
|
||||
$vhost_extra_params = {},
|
||||
) {
|
||||
|
||||
# We build the param needed for horizon class
|
||||
@ -104,10 +105,12 @@ class cloud::dashboard(
|
||||
} else {
|
||||
$setenvif = []
|
||||
}
|
||||
$vhost_extra_params = {
|
||||
$extra_params = {
|
||||
'add_listen' => true,
|
||||
'setenvif' => $setenvif
|
||||
}
|
||||
$vhost_extra_params_real = merge ($vhost_extra_params, $extra_params)
|
||||
|
||||
ensure_resource('class', 'apache', {
|
||||
default_vhost => false
|
||||
})
|
||||
@ -128,7 +131,7 @@ class cloud::dashboard(
|
||||
horizon_cert => $horizon_cert,
|
||||
horizon_key => $horizon_key,
|
||||
horizon_ca => $horizon_ca,
|
||||
vhost_extra_params => $vhost_extra_params,
|
||||
vhost_extra_params => $vhost_extra_params_real,
|
||||
openstack_endpoint_type => $os_endpoint_type,
|
||||
allowed_hosts => $allowed_hosts,
|
||||
}
|
||||
|
@ -60,6 +60,25 @@ describe 'cloud::dashboard' do
|
||||
is_expected.to contain_class('apache').with(:default_vhost => false)
|
||||
end
|
||||
|
||||
context 'with custom apache2 vhost parameters' do
|
||||
before do
|
||||
params.merge!(
|
||||
:vhost_extra_params => {
|
||||
'ssl_protocol' => 'all -SSLv3 -SSLv2'
|
||||
})
|
||||
end
|
||||
|
||||
it 'configure horizon with custom vhost configuration' do
|
||||
is_expected.to contain_class('horizon').with(
|
||||
:vhost_extra_params => {
|
||||
'add_listen' => true ,
|
||||
'setenvif' => ['X-Forwarded-Proto https HTTPS=1'],
|
||||
'ssl_protocol' => 'all -SSLv3 -SSLv2'
|
||||
},
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with multiple allowed_hosts' do
|
||||
before do
|
||||
params.merge!(:allowed_hosts => ['horizon.openstack.org', 'vip.openstack.org'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user