Pass $ceilometer to openstack::glance and openstack::controller

Commit I00db51ceb4121e73bfe7e256b895e4fae122a496 added possibility to
control whether Ceilometer notifications are sent, but didn't add
appropriate parameter to higher level classes, making notifications
disabled even if Ceilometer is enabled.

Additionally backport I3f2c29adbfb605ef288962f72ba81c11811cb357 to
glance module.

Change-Id: I2db7c13cd9c59e29e42e5000961eeedc6717e1ee
Closes-Bug: 1433075
Related-Bug: 1425982
This commit is contained in:
Bartłomiej Piotrowski 2015-03-17 15:02:36 +01:00
parent 296050759a
commit 690543dcf8
4 changed files with 48 additions and 40 deletions

View File

@ -34,7 +34,9 @@
# Defaults to 'notifications'
# [*rabbit_durable_queues*]
# Defaults to false
#
# [*notification_driver*]
# Notification driver to use. Defaults to 'messaging'.
class glance::notify::rabbitmq(
$rabbit_password,
$rabbit_userid = 'guest',
@ -51,7 +53,7 @@ class glance::notify::rabbitmq(
$rabbit_notification_topic = 'notifications',
$rabbit_durable_queues = false,
$amqp_durable_queues = false,
$ceilometer = false,
$notification_driver = 'messaging',
) {
if $rabbit_durable_queues {
@ -76,6 +78,7 @@ class glance::notify::rabbitmq(
}
glance_api_config {
'DEFAULT/notification_driver': value => $notification_driver;
'DEFAULT/rabbit_virtual_host': value => $rabbit_virtual_host;
'DEFAULT/rabbit_password': value => $rabbit_password;
'DEFAULT/rabbit_userid': value => $rabbit_userid;
@ -85,12 +88,6 @@ class glance::notify::rabbitmq(
'DEFAULT/amqp_durable_queues': value => $amqp_durable_queues_real;
}
if $ceilometer {
glance_api_config { 'DEFAULT/notification_driver': value => 'messaging' }
} else {
glance_api_config { 'DEFAULT/notification_driver': ensure => absent }
}
if $rabbit_use_ssl {
glance_api_config { 'DEFAULT/kombu_ssl_version': value => $kombu_ssl_version }

View File

@ -310,6 +310,7 @@ class openstack::controller (
idle_timeout => $idle_timeout,
novnc_address => $novnc_address,
ha_mode => $ha_mode,
ceilometer => $ceilometer,
neutron_metadata_proxy_shared_secret => $network_provider ? {'nova'=>undef, 'neutron'=>$neutron_metadata_proxy_secret },
}

View File

@ -79,6 +79,7 @@ class openstack::glance (
$known_stores = false,
$rbd_store_user = 'images',
$rbd_store_pool = 'images',
$ceilometer = false,
) {
validate_string($glance_user_password)
validate_string($glance_db_password)
@ -177,6 +178,12 @@ class openstack::glance (
# Configure rabbitmq notifications
# TODO(bogdando) sync qpid support from upstream
if $ceilometer {
$notification_driver = 'messaging'
} else {
$notification_driver = 'noop'
}
class { 'glance::notify::rabbitmq':
rabbit_password => $rabbit_password,
rabbit_userid => $rabbit_userid,
@ -188,6 +195,7 @@ class openstack::glance (
rabbit_notification_exchange => $rabbit_notification_exchange,
rabbit_notification_topic => $rabbit_notification_topic,
amqp_durable_queues => $amqp_durable_queues,
notification_driver => $notification_driver,
}
glance_api_config {

View File

@ -12,6 +12,7 @@ $rabbit_hash = hiera('rabbit_hash')
$amqp_hosts = hiera('amqp_hosts')
$max_pool_size = hiera('max_pool_size')
$max_overflow = hiera('max_overflow')
$ceilometer_hash = hiera('ceilometer',{})
$db_type = 'mysql'
$db_host = $management_vip
@ -53,38 +54,39 @@ if ($storage_hash['images_ceph']) {
###############################################################################
class { 'openstack::glance':
verbose => $verbose,
debug => $debug,
db_type => $db_type,
db_host => $db_host,
glance_db_user => $glance_db_user,
glance_db_dbname => $glance_db_dbname,
glance_db_password => $glance_db_password,
glance_user_password => $glance_user_password,
glance_vcenter_host => $glance_vcenter_host,
glance_vcenter_user => $glance_vcenter_user,
glance_vcenter_password => $glance_vcenter_password,
glance_vcenter_datacenter => $glance_vcenter_datacenter,
glance_vcenter_datastore => $glance_vcenter_datastore,
glance_vcenter_image_dir => $glance_vcenter_image_dir,
auth_uri => $auth_uri,
keystone_host => $service_endpoint,
bind_host => $api_bind_address,
enabled => $enabled,
glance_backend => $glance_backend,
registry_host => $service_endpoint,
use_syslog => $use_syslog,
syslog_log_facility => $syslog_log_facility,
glance_image_cache_max_size => $glance_image_cache_max_size,
max_retries => $max_retries,
max_pool_size => $max_pool_size,
max_overflow => $max_overflow,
idle_timeout => $idle_timeout,
rabbit_password => $rabbit_password,
rabbit_userid => $rabbit_user,
rabbit_hosts => $rabbit_hosts,
rabbit_virtual_host => $rabbit_virtual_host,
known_stores => $glance_known_stores,
verbose => $verbose,
debug => $debug,
db_type => $db_type,
db_host => $db_host,
glance_db_user => $glance_db_user,
glance_db_dbname => $glance_db_dbname,
glance_db_password => $glance_db_password,
glance_user_password => $glance_user_password,
glance_vcenter_host => $glance_vcenter_host,
glance_vcenter_user => $glance_vcenter_user,
glance_vcenter_password => $glance_vcenter_password,
glance_vcenter_datacenter => $glance_vcenter_datacenter,
glance_vcenter_datastore => $glance_vcenter_datastore,
glance_vcenter_image_dir => $glance_vcenter_image_dir,
auth_uri => $auth_uri,
keystone_host => $service_endpoint,
bind_host => $api_bind_address,
enabled => $enabled,
glance_backend => $glance_backend,
registry_host => $service_endpoint,
use_syslog => $use_syslog,
syslog_log_facility => $syslog_log_facility,
glance_image_cache_max_size => $glance_image_cache_max_size,
max_retries => $max_retries,
max_pool_size => $max_pool_size,
max_overflow => $max_overflow,
idle_timeout => $idle_timeout,
rabbit_password => $rabbit_password,
rabbit_userid => $rabbit_user,
rabbit_hosts => $rabbit_hosts,
rabbit_virtual_host => $rabbit_virtual_host,
known_stores => $glance_known_stores,
ceilometer => $ceilometer_hash[enabled],
}
####### Disable upstart startup on install #######