Adapt synced Cinder module for Fuel usage

Key moments:
  *Update section for cinder_config
  *Add params for "cinder" class
  *Remove duplicated params for cinder config

Partially Implements: blueprint upgrade-openstack-puppet-modules

Change-Id: Icd537cb4f817fa0e4b2e2ac32eab531dfda6ac1c
This commit is contained in:
Maksym Yatsenko 2015-06-24 18:05:58 +03:00
parent d0f0bb496a
commit 7672d6ffb8
4 changed files with 58 additions and 37 deletions

View File

@ -65,6 +65,5 @@ class cinder::db::mysql (
collate => $collate,
allowed_hosts => $allowed_hosts,
}
::Openstacklib::Db::Mysql['cinder'] ~> Exec<| title == 'cinder-manage db_sync' |>
}

View File

@ -1,8 +1,8 @@
# [use_syslog] Rather or not service should log to syslog. Optional. Defaults to false.
# [*use_syslog*] Rather or not service should log to syslog. Optional. Defaults to false.
# [syslog_log_facility] Facility for syslog, if used. Optional. Note: duplicating conf option
# [*syslog_log_facility*] Facility for syslog, if used. Optional. Note: duplicating conf option
# wouldn't have been used, but more powerfull rsyslog features managed via conf template instead
# [ceilometer] true if we use ceilometer
# [*ceilometer*] true if we use ceilometer
class openstack::cinder(
$sql_connection,
@ -64,9 +64,9 @@ class openstack::cinder(
}
if $queue_provider == 'rabbitmq' and $rabbit_ha_queues {
Cinder_config['DEFAULT/rabbit_ha_queues']->Service<| title == 'cinder-api'|>
Cinder_config['DEFAULT/rabbit_ha_queues']->Service<| title == 'cinder-volume' |>
Cinder_config['DEFAULT/rabbit_ha_queues']->Service<| title == 'cinder-scheduler' |>
Cinder_config['oslo_messaging_rabbit/rabbit_ha_queues']->Service<| title == 'cinder-api'|>
Cinder_config['oslo_messaging_rabbit/rabbit_ha_queues']->Service<| title == 'cinder-volume' |>
Cinder_config['oslo_messaging_rabbit/rabbit_ha_queues']->Service<| title == 'cinder-scheduler' |>
}
case $queue_provider {
@ -90,21 +90,24 @@ class openstack::cinder(
$rabbit_host_array = split($amqp_hosts, ':')
}
class { '::cinder':
package_ensure => $::openstack_version['cinder'],
rpc_backend => 'cinder.openstack.common.rpc.impl_kombu',
rabbit_host => $rabbit_host_array[0],
rabbit_port => $rabbit_host_array[1],
rabbit_hosts => $rabbit_hosts_real,
rabbit_userid => $amqp_user,
rabbit_password => $amqp_password,
rabbit_virtual_host => $rabbit_virtual_host,
database_connection => $sql_connection,
verbose => $verbose,
use_syslog => $use_syslog,
log_facility => $syslog_log_facility,
debug => $debug,
database_idle_timeout => $idle_timeout,
control_exchange => 'cinder',
package_ensure => $::openstack_version['cinder'],
rpc_backend => 'cinder.openstack.common.rpc.impl_kombu',
rabbit_host => $rabbit_host_array[0],
rabbit_port => $rabbit_host_array[1],
rabbit_hosts => $rabbit_hosts_real,
rabbit_userid => $amqp_user,
rabbit_password => $amqp_password,
rabbit_virtual_host => $rabbit_virtual_host,
database_connection => $sql_connection,
verbose => $verbose,
use_syslog => $use_syslog,
log_facility => $syslog_log_facility,
debug => $debug,
database_idle_timeout => $idle_timeout,
database_max_pool_size => $max_pool_size,
database_max_retries => $max_retries,
database_max_overflow => $max_overflow,
control_exchange => 'cinder',
}
cinder_config {
'DEFAULT/kombu_reconnect_delay': value => '5.0';
@ -199,13 +202,6 @@ class openstack::cinder(
}
}
# additional cinder configuration
cinder_config {
'database/max_pool_size': value => $max_pool_size;
'database/max_retries': value => $max_retries;
'database/max_overflow': value => $max_overflow;
}
if $keystone_enabled {
cinder_config {
'keystone_authtoken/auth_protocol': value => $keystone_auth_protocol;
@ -220,6 +216,6 @@ class openstack::cinder(
}
if $ceilometer {
class { "cinder::ceilometer": }
class { 'cinder::ceilometer': }
}
}

View File

@ -17,12 +17,11 @@ describe manifest do
'allowed_hosts' => allowed_hosts,
)
end
#TODO: uncomment in keystone module adaptation patch
# allowed_hosts.each do |host|
# it "should define openstacklib::db::mysql::host_access for #{cinder_db_dbname} DB for #{host}" do
# should contain_openstacklib__db__mysql__host_access("#{cinder_db_dbname}_#{host}")
# end
# end
allowed_hosts.each do |host|
it "should define openstacklib::db::mysql::host_access for #{cinder_db_dbname} DB for #{host}" do
should contain_openstacklib__db__mysql__host_access("#{cinder_db_dbname}_#{host}")
end
end
end # end of shared_examples
test_ubuntu_and_centos manifest
end

View File

@ -3,6 +3,33 @@ require 'shared-examples'
manifest = 'openstack-cinder/openstack-cinder.pp'
describe manifest do
test_ubuntu_and_centos manifest
shared_examples 'catalog' do
max_pool_size = 20
max_retries = '-1'
max_overflow = 20
if ! (Noop.hiera 'queue_provider')
queue_provider = 'rabbitmq'
end
if queue_provider
it 'ensures cinder_config contains needed resources before cinder-* services run' do
should contain_cinder_config('oslo_messaging_rabbit/rabbit_ha_queues').with(
:before => ['Service[cinder-api]','Service[cinder-volume]','Service[cinder-scheduler]'],
)
end
end
it 'should declare ::cinder class with correct database_max_* parameters' do
should contain_class('cinder').with(
'database_max_pool_size' => max_pool_size,
'database_max_retries' => max_retries,
'database_max_overflow' => max_overflow,
)
end
end # end of shared_examples
test_ubuntu_and_centos manifest
end