Merge "Handle horizon's cinder backup feature"

This commit is contained in:
Jenkins 2016-01-21 12:50:42 +00:00 committed by Gerrit Code Review
commit b07a739e97
4 changed files with 20 additions and 2 deletions

View File

@ -26,6 +26,7 @@ class openstack::horizon (
$cache_server_port = '11211',
$neutron = false,
$neutron_options = {},
$cinder_options = {},
$horizon_app_links = undef,
$keystone_url = 'http://127.0.0.1:5000/v2.0/',
$keystone_default_role = '_member_',
@ -94,6 +95,7 @@ class openstack::horizon (
allowed_hosts => '*',
secure_cookies => false,
log_handler => $log_handler,
cinder_options => $cinder_options,
neutron_options => $neutron_options,
custom_theme_path => $custom_theme_path,
redirect_type => 'temp', # LP#1385133

View File

@ -12,7 +12,8 @@ describe 'openstack::horizon' do
let(:params) { {
:secret_key => 'very_secret_key',
:file_upload_max_size => '10737418235',
:file_upload_temp_dir => upload_dir
:file_upload_temp_dir => upload_dir,
:cinder_options => { 'enable_backup' => false },
} }
let :facts do
@ -35,6 +36,12 @@ describe 'openstack::horizon' do
# )
end
it 'contains horizon' do
should contain_class('horizon').with(
:cinder_options => p[:cinder_options]
)
end
it 'contains horizon::wsgi::apache' do
if facts[:osfamily] == 'Debian'
custom_fragment = "\n <Directory /usr/share/openstack-dashboard/openstack_dashboard/wsgi>\n Order allow,deny\n Allow from all\n </Directory>\n\n LimitRequestBody 10737418235\n\n"

View File

@ -5,6 +5,7 @@ $horizon_hash = hiera_hash('horizon', {})
$service_endpoint = hiera('service_endpoint')
$memcached_server = hiera('memcached_addresses')
$bind_address = get_network_role_property('horizon', 'ipaddr')
$storage_hash = hiera_hash('storage_hash', {})
$neutron_advanced_config = hiera_hash('neutron_advanced_configuration', {})
$public_ssl = hiera('public_ssl')
$ssl_no_verify = $public_ssl['horizon']
@ -35,6 +36,7 @@ $internal_auth_port = '5000'
$keystone_api = 'v2.0'
$keystone_url = "${internal_auth_protocol}://${internal_auth_address}:${internal_auth_port}/${keystone_api}"
$cinder_options = {'enable_backup' => pick($storage_hash['volumes_ceph'], false)}
$neutron_options = {'enable_distributed_router' => $neutron_dvr}
$hypervisor_options = {'enable_quotas' => hiera('nova_quota')}
@ -70,6 +72,7 @@ class { 'openstack::horizon':
use_syslog => hiera('use_syslog', true),
hypervisor_options => $hypervisor_options,
servername => hiera('public_vip'),
cinder_options => $cinder_options,
neutron_options => $neutron_options,
overview_days_range => $overview_days_range,
file_upload_temp_dir => $file_upload_temp_dir,

View File

@ -67,12 +67,18 @@ describe manifest do
end
end
storage_hash = Noop.hiera 'storage_hash'
let(:cinder_options) do
{ 'enable_backup' => storage_hash.fetch('volumes_ceph', false) }
end
###########################################################################
it 'should declare openstack::horizon class' do
should contain_class('openstack::horizon').with(
'cinder_options' => cinder_options,
'hypervisor_options' => {'enable_quotas' => nova_quota},
'bind_address' => bind_address
'bind_address' => bind_address
)
end