dashboard: bring specific vhost flexibility
Signed-off-by: Dimitri Savineau <dimitri.savineau@enovance.com>
This commit is contained in:
@@ -93,6 +93,7 @@ class cloud::dashboard(
|
|||||||
$ssl_forward = false,
|
$ssl_forward = false,
|
||||||
$os_endpoint_type = undef,
|
$os_endpoint_type = undef,
|
||||||
$allowed_hosts = $::fqdn,
|
$allowed_hosts = $::fqdn,
|
||||||
|
$vhost_extra_params = {},
|
||||||
) {
|
) {
|
||||||
|
|
||||||
# We build the param needed for horizon class
|
# We build the param needed for horizon class
|
||||||
@@ -104,10 +105,12 @@ class cloud::dashboard(
|
|||||||
} else {
|
} else {
|
||||||
$setenvif = []
|
$setenvif = []
|
||||||
}
|
}
|
||||||
$vhost_extra_params = {
|
$extra_params = {
|
||||||
'add_listen' => true,
|
'add_listen' => true,
|
||||||
'setenvif' => $setenvif
|
'setenvif' => $setenvif
|
||||||
}
|
}
|
||||||
|
$vhost_extra_params_real = merge ($vhost_extra_params, $extra_params)
|
||||||
|
|
||||||
ensure_resource('class', 'apache', {
|
ensure_resource('class', 'apache', {
|
||||||
default_vhost => false
|
default_vhost => false
|
||||||
})
|
})
|
||||||
@@ -128,7 +131,7 @@ class cloud::dashboard(
|
|||||||
horizon_cert => $horizon_cert,
|
horizon_cert => $horizon_cert,
|
||||||
horizon_key => $horizon_key,
|
horizon_key => $horizon_key,
|
||||||
horizon_ca => $horizon_ca,
|
horizon_ca => $horizon_ca,
|
||||||
vhost_extra_params => $vhost_extra_params,
|
vhost_extra_params => $vhost_extra_params_real,
|
||||||
openstack_endpoint_type => $os_endpoint_type,
|
openstack_endpoint_type => $os_endpoint_type,
|
||||||
allowed_hosts => $allowed_hosts,
|
allowed_hosts => $allowed_hosts,
|
||||||
}
|
}
|
||||||
|
@@ -60,6 +60,25 @@ describe 'cloud::dashboard' do
|
|||||||
is_expected.to contain_class('apache').with(:default_vhost => false)
|
is_expected.to contain_class('apache').with(:default_vhost => false)
|
||||||
end
|
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
|
context 'with multiple allowed_hosts' do
|
||||||
before do
|
before do
|
||||||
params.merge!(:allowed_hosts => ['horizon.openstack.org', 'vip.openstack.org'])
|
params.merge!(:allowed_hosts => ['horizon.openstack.org', 'vip.openstack.org'])
|
||||||
|
Reference in New Issue
Block a user