diff --git a/deployment/puppet/openstack/manifests/horizon.pp b/deployment/puppet/openstack/manifests/horizon.pp index 3d63ca41ee..20c827f57b 100644 --- a/deployment/puppet/openstack/manifests/horizon.pp +++ b/deployment/puppet/openstack/manifests/horizon.pp @@ -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 diff --git a/deployment/puppet/openstack/spec/classes/openstack_horizon_spec.rb b/deployment/puppet/openstack/spec/classes/openstack_horizon_spec.rb index ca4830c78b..a9c803ac94 100644 --- a/deployment/puppet/openstack/spec/classes/openstack_horizon_spec.rb +++ b/deployment/puppet/openstack/spec/classes/openstack_horizon_spec.rb @@ -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 \n Order allow,deny\n Allow from all\n \n\n LimitRequestBody 10737418235\n\n" diff --git a/deployment/puppet/osnailyfacter/modular/horizon/horizon.pp b/deployment/puppet/osnailyfacter/modular/horizon/horizon.pp index ef2cf6c71d..7df4139152 100644 --- a/deployment/puppet/osnailyfacter/modular/horizon/horizon.pp +++ b/deployment/puppet/osnailyfacter/modular/horizon/horizon.pp @@ -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, diff --git a/tests/noop/spec/hosts/horizon/horizon_spec.rb b/tests/noop/spec/hosts/horizon/horizon_spec.rb index c0d5382914..ad6fa10e3e 100644 --- a/tests/noop/spec/hosts/horizon/horizon_spec.rb +++ b/tests/noop/spec/hosts/horizon/horizon_spec.rb @@ -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