Switch glance to os_service_default facts

Change-Id: If860858e2bdfe0387b6a3260b81a97625d05b9fe
This commit is contained in:
Mykyta Karpin 2016-03-31 12:20:23 +03:00
parent 4923d0441c
commit 037545fb3e
20 changed files with 350 additions and 625 deletions

View File

@ -22,7 +22,7 @@
# #
# [*bind_host*] # [*bind_host*]
# (optional) The address of the host to bind to. # (optional) The address of the host to bind to.
# Default: 0.0.0.0 # Default: $::os_service_default.
# #
# [*bind_port*] # [*bind_port*]
# (optional) The port the server should bind to. # (optional) The port the server should bind to.
@ -30,7 +30,7 @@
# #
# [*backlog*] # [*backlog*]
# (optional) Backlog requests when creating socket # (optional) Backlog requests when creating socket
# Default: 4096 # Default: $::os_service_default.
# #
# [*workers*] # [*workers*]
# (optional) Number of Glance API worker processes to start # (optional) Number of Glance API worker processes to start
@ -52,11 +52,11 @@
# #
# [*registry_port*] # [*registry_port*]
# (optional) The port of the Glance registry service. # (optional) The port of the Glance registry service.
# Default: 9191 # Default: $::os_service_default.
# #
# [*registry_client_protocol*] # [*registry_client_protocol*]
# (optional) The protocol of the Glance registry service. # (optional) The protocol of the Glance registry service.
# Default: http # Default: $::os_service_default.
# #
# [*scrub_time*] # [*scrub_time*]
# (optional) The amount of time in seconds to delay before performing a delete. # (optional) The amount of time in seconds to delay before performing a delete.
@ -157,7 +157,7 @@
# #
# [*show_image_direct_url*] # [*show_image_direct_url*]
# (optional) Expose image location to trusted clients. # (optional) Expose image location to trusted clients.
# Defaults to false. # Defaults to $::os_service_default.
# #
# [*show_multiple_locations*] # [*show_multiple_locations*]
# (optional) Whether to include the backend image locations in image # (optional) Whether to include the backend image locations in image
@ -272,15 +272,15 @@ class glance::api(
$package_ensure = 'present', $package_ensure = 'present',
$verbose = undef, $verbose = undef,
$debug = undef, $debug = undef,
$bind_host = '0.0.0.0', $bind_host = $::os_service_default,
$bind_port = '9292', $bind_port = '9292',
$backlog = '4096', $backlog = $::os_service_default,
$workers = $::processorcount, $workers = $::processorcount,
$log_file = undef, $log_file = undef,
$log_dir = undef, $log_dir = undef,
$registry_host = '0.0.0.0', $registry_host = '0.0.0.0',
$registry_port = '9191', $registry_port = $::os_service_default,
$registry_client_protocol = 'http', $registry_client_protocol = $::os_service_default,
$scrub_time = $::os_service_default, $scrub_time = $::os_service_default,
$delayed_delete = $::os_service_default, $delayed_delete = $::os_service_default,
$auth_type = 'keystone', $auth_type = 'keystone',
@ -296,7 +296,7 @@ class glance::api(
$use_syslog = undef, $use_syslog = undef,
$use_stderr = undef, $use_stderr = undef,
$log_facility = undef, $log_facility = undef,
$show_image_direct_url = false, $show_image_direct_url = $::os_service_default,
$show_multiple_locations = $::os_service_default, $show_multiple_locations = $::os_service_default,
$location_strategy = $::os_service_default, $location_strategy = $::os_service_default,
$purge_config = false, $purge_config = false,

View File

@ -6,23 +6,23 @@
# #
# [*verbose*] # [*verbose*]
# (Optional) Should the daemons log verbose messages # (Optional) Should the daemons log verbose messages
# Defaults to 'false' # Defaults to $::os_service_default.
# #
# [*debug*] # [*debug*]
# (Optional) Should the daemons log debug messages # (Optional) Should the daemons log debug messages
# Defaults to 'false' # Defaults to $::os_service_default.
# #
# [*use_syslog*] # [*use_syslog*]
# (Optional) Use syslog for logging. # (Optional) Use syslog for logging.
# Defaults to 'false' # Defaults to $::os_service_default.
# #
# [*use_stderr*] # [*use_stderr*]
# (optional) Use stderr for logging # (optional) Use stderr for logging
# Defaults to 'true' # Defaults to $::os_service_default.
# #
# [*log_facility*] # [*log_facility*]
# (Optional) Syslog facility to receive log lines. # (Optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER' # Defaults to $::os_service_default.
# #
# [*log_dir*] # [*log_dir*]
# (optional) Directory where logs should be stored. # (optional) Directory where logs should be stored.
@ -35,34 +35,34 @@
# #
# [*logging_context_format_string*] # [*logging_context_format_string*]
# (optional) Format string to use for log messages with context. # (optional) Format string to use for log messages with context.
# Defaults to undef. # Defaults to $::os_service_default.
# Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\ # Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\
# [%(request_id)s %(user_identity)s] %(instance)s%(message)s' # [%(request_id)s %(user_identity)s] %(instance)s%(message)s'
# #
# [*logging_default_format_string*] # [*logging_default_format_string*]
# (optional) Format string to use for log messages without context. # (optional) Format string to use for log messages without context.
# Defaults to undef. # Defaults to $::os_service_default.
# Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\ # Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\
# [-] %(instance)s%(message)s' # [-] %(instance)s%(message)s'
# #
# [*logging_debug_format_suffix*] # [*logging_debug_format_suffix*]
# (optional) Formatted data to append to log format when level is DEBUG. # (optional) Formatted data to append to log format when level is DEBUG.
# Defaults to undef. # Defaults to $::os_service_default.
# Example: '%(funcName)s %(pathname)s:%(lineno)d' # Example: '%(funcName)s %(pathname)s:%(lineno)d'
# #
# [*logging_exception_prefix*] # [*logging_exception_prefix*]
# (optional) Prefix each line of exception output with this format. # (optional) Prefix each line of exception output with this format.
# Defaults to undef. # Defaults to $::os_service_default.
# Example: '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s' # Example: '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s'
# #
# [*log_config_append*] # [*log_config_append*]
# The name of an additional logging configuration file. # The name of an additional logging configuration file.
# Defaults to undef. # Defaults to $::os_service_default.
# See https://docs.python.org/2/howto/logging.html # See https://docs.python.org/2/howto/logging.html
# #
# [*default_log_levels*] # [*default_log_levels*]
# (optional) Hash of logger (keys) and level (values) pairs. # (optional) Hash of logger (keys) and level (values) pairs.
# Defaults to undef. # Defaults to $::os_service_default.
# Example: # Example:
# { 'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN', # { 'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
# 'qpid' => 'WARN', 'sqlalchemy' => 'WARN', 'suds' => 'INFO', # 'qpid' => 'WARN', 'sqlalchemy' => 'WARN', 'suds' => 'INFO',
@ -71,48 +71,48 @@
# #
# [*publish_errors*] # [*publish_errors*]
# (optional) Publish error events (boolean value). # (optional) Publish error events (boolean value).
# Defaults to undef (false if unconfigured). # Defaults to $::os_service_default.
# #
# [*fatal_deprecations*] # [*fatal_deprecations*]
# (optional) Make deprecations fatal (boolean value) # (optional) Make deprecations fatal (boolean value)
# Defaults to undef (false if unconfigured). # Defaults to $::os_service_default.
# #
# [*instance_format*] # [*instance_format*]
# (optional) If an instance is passed with the log message, format it # (optional) If an instance is passed with the log message, format it
# like this (string value). # like this (string value).
# Defaults to undef. # Defaults to $::os_service_default.
# Example: '[instance: %(uuid)s] ' # Example: '[instance: %(uuid)s] '
# #
# [*instance_uuid_format*] # [*instance_uuid_format*]
# (optional) If an instance UUID is passed with the log message, format # (optional) If an instance UUID is passed with the log message, format
# it like this (string value). # it like this (string value).
# Defaults to undef. # Defaults to $::os_service_default.
# Example: instance_uuid_format='[instance: %(uuid)s] ' # Example: instance_uuid_format='[instance: %(uuid)s] '
# #
# [*log_date_format*] # [*log_date_format*]
# (optional) Format string for %%(asctime)s in log records. # (optional) Format string for %%(asctime)s in log records.
# Defaults to undef. # Defaults to $::os_service_default.
# Example: 'Y-%m-%d %H:%M:%S' # Example: 'Y-%m-%d %H:%M:%S'
class glance::api::logging( class glance::api::logging(
$use_syslog = false, $use_syslog = $::os_service_default,
$use_stderr = true, $use_stderr = $::os_service_default,
$log_facility = 'LOG_USER', $log_facility = $::os_service_default,
$log_dir = '/var/log/glance', $log_dir = '/var/log/glance',
$log_file = '/var/log/glance/api.log', $log_file = '/var/log/glance/api.log',
$verbose = false, $verbose = $::os_service_default,
$debug = false, $debug = $::os_service_default,
$logging_context_format_string = undef, $logging_context_format_string = $::os_service_default,
$logging_default_format_string = undef, $logging_default_format_string = $::os_service_default,
$logging_debug_format_suffix = undef, $logging_debug_format_suffix = $::os_service_default,
$logging_exception_prefix = undef, $logging_exception_prefix = $::os_service_default,
$log_config_append = undef, $log_config_append = $::os_service_default,
$default_log_levels = undef, $default_log_levels = $::os_service_default,
$publish_errors = undef, $publish_errors = $::os_service_default,
$fatal_deprecations = undef, $fatal_deprecations = $::os_service_default,
$instance_format = undef, $instance_format = $::os_service_default,
$instance_uuid_format = undef, $instance_uuid_format = $::os_service_default,
$log_date_format = undef, $log_date_format = $::os_service_default,
) { ) {
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function # NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
@ -125,140 +125,31 @@ class glance::api::logging(
$verbose_real = pick($::glance::api::verbose,$verbose) $verbose_real = pick($::glance::api::verbose,$verbose)
$debug_real = pick($::glance::api::debug,$debug) $debug_real = pick($::glance::api::debug,$debug)
glance_api_config { if is_service_default($default_log_levels) {
'DEFAULT/debug' : value => $debug_real; $default_log_levels_real = $default_log_levels
'DEFAULT/verbose' : value => $verbose_real; } else {
'DEFAULT/use_stderr' : value => $use_stderr_real; $default_log_levels_real = join(sort(join_keys_to_values($default_log_levels, '=')), ',')
'DEFAULT/use_syslog' : value => $use_syslog_real;
'DEFAULT/log_dir' : value => $log_dir_real;
'DEFAULT/log_file' : value => $log_file_real;
'DEFAULT/syslog_log_facility': value => $log_facility_real;
} }
if $logging_context_format_string { glance_api_config {
glance_api_config { 'DEFAULT/debug': value => $debug_real;
'DEFAULT/logging_context_format_string' : 'DEFAULT/verbose': value => $verbose_real;
value => $logging_context_format_string; 'DEFAULT/use_stderr': value => $use_stderr_real;
} 'DEFAULT/use_syslog': value => $use_syslog_real;
} 'DEFAULT/log_dir': value => $log_dir_real;
else { 'DEFAULT/log_file': value => $log_file_real;
glance_api_config { 'DEFAULT/syslog_log_facility': value => $log_facility_real;
'DEFAULT/logging_context_format_string' : ensure => absent; 'DEFAULT/logging_context_format_string': value => $logging_context_format_string;
} 'DEFAULT/logging_default_format_string': value => $logging_default_format_string;
} 'DEFAULT/logging_debug_format_suffix': value => $logging_debug_format_suffix;
'DEFAULT/logging_exception_prefix': value => $logging_exception_prefix;
if $logging_default_format_string { 'DEFAULT/log_config_append': value => $log_config_append;
glance_api_config { 'DEFAULT/default_log_levels': value => $default_log_levels_real;
'DEFAULT/logging_default_format_string' : 'DEFAULT/publish_errors': value => $publish_errors;
value => $logging_default_format_string; 'DEFAULT/fatal_deprecations': value => $fatal_deprecations;
} 'DEFAULT/instance_format': value => $instance_format;
} 'DEFAULT/instance_uuid_format': value => $instance_uuid_format;
else { 'DEFAULT/log_date_format': value => $log_date_format;
glance_api_config { }
'DEFAULT/logging_default_format_string' : ensure => absent;
}
}
if $logging_debug_format_suffix {
glance_api_config {
'DEFAULT/logging_debug_format_suffix' :
value => $logging_debug_format_suffix;
}
}
else {
glance_api_config {
'DEFAULT/logging_debug_format_suffix' : ensure => absent;
}
}
if $logging_exception_prefix {
glance_api_config {
'DEFAULT/logging_exception_prefix' : value => $logging_exception_prefix;
}
}
else {
glance_api_config {
'DEFAULT/logging_exception_prefix' : ensure => absent;
}
}
if $log_config_append {
glance_api_config {
'DEFAULT/log_config_append' : value => $log_config_append;
}
}
else {
glance_api_config {
'DEFAULT/log_config_append' : ensure => absent;
}
}
if $default_log_levels {
glance_api_config {
'DEFAULT/default_log_levels' :
value => join(sort(join_keys_to_values($default_log_levels, '=')), ',');
}
}
else {
glance_api_config {
'DEFAULT/default_log_levels' : ensure => absent;
}
}
if $publish_errors {
glance_api_config {
'DEFAULT/publish_errors' : value => $publish_errors;
}
}
else {
glance_api_config {
'DEFAULT/publish_errors' : ensure => absent;
}
}
if $fatal_deprecations {
glance_api_config {
'DEFAULT/fatal_deprecations' : value => $fatal_deprecations;
}
}
else {
glance_api_config {
'DEFAULT/fatal_deprecations' : ensure => absent;
}
}
if $instance_format {
glance_api_config {
'DEFAULT/instance_format' : value => $instance_format;
}
}
else {
glance_api_config {
'DEFAULT/instance_format' : ensure => absent;
}
}
if $instance_uuid_format {
glance_api_config {
'DEFAULT/instance_uuid_format' : value => $instance_uuid_format;
}
}
else {
glance_api_config {
'DEFAULT/instance_uuid_format' : ensure => absent;
}
}
if $log_date_format {
glance_api_config {
'DEFAULT/log_date_format' : value => $log_date_format;
}
}
else {
glance_api_config {
'DEFAULT/log_date_format' : ensure => absent;
}
}
} }

View File

@ -25,12 +25,12 @@
# (optional) Info to match when looking for cinder in the service catalog. # (optional) Info to match when looking for cinder in the service catalog.
# Format is : separated values of the form: # Format is : separated values of the form:
# <service_type>:<service_name>:<endpoint_type> (string value) # <service_type>:<service_name>:<endpoint_type> (string value)
# Defaults to 'volume:cinder:publicURL' # Defaults to $::os_service_default.
# #
# [*cinder_endpoint_template*] # [*cinder_endpoint_template*]
# (optional) Override service catalog lookup with template for cinder endpoint. # (optional) Override service catalog lookup with template for cinder endpoint.
# Should be a valid URL. Example: 'http://localhost:8776/v1/%(project_id)s' # Should be a valid URL. Example: 'http://localhost:8776/v1/%(project_id)s'
# Defaults to 'undef' # Defaults to $::os_service_default.
# #
# [*os_region_name*] # [*os_region_name*]
# (optional) The os_region_name parameter is deprecated and has no effect. # (optional) The os_region_name parameter is deprecated and has no effect.
@ -40,17 +40,17 @@
# [*cinder_ca_certificates_file*] # [*cinder_ca_certificates_file*]
# (optional) Location of ca certicate file to use for cinder client requests. # (optional) Location of ca certicate file to use for cinder client requests.
# Should be a valid ca certicate file # Should be a valid ca certicate file
# Defaults to undef # Defaults to $::os_service_default.
# #
# [*cinder_http_retries*] # [*cinder_http_retries*]
# (optional) Number of cinderclient retries on failed http calls. # (optional) Number of cinderclient retries on failed http calls.
# Should be a valid integer # Should be a valid integer
# Defaults to '3' # Defaults to $::os_service_default.
# #
# [*cinder_api_insecure*] # [*cinder_api_insecure*]
# (optional) Allow to perform insecure SSL requests to cinder. # (optional) Allow to perform insecure SSL requests to cinder.
# Should be a valid boolean value # Should be a valid boolean value
# Defaults to false # Defaults to $::os_service_default.
# #
# [*multi_store*] # [*multi_store*]
# (optional) Boolean describing if multiple backends will be configured # (optional) Boolean describing if multiple backends will be configured
@ -62,11 +62,11 @@
# #
class glance::backend::cinder( class glance::backend::cinder(
$os_region_name = undef, $os_region_name = undef,
$cinder_ca_certificates_file = undef, $cinder_ca_certificates_file = $::os_service_default,
$cinder_api_insecure = false, $cinder_api_insecure = $::os_service_default,
$cinder_catalog_info = 'volume:cinder:publicURL', $cinder_catalog_info = $::os_service_default,
$cinder_endpoint_template = undef, $cinder_endpoint_template = $::os_service_default,
$cinder_http_retries = '3', $cinder_http_retries = $::os_service_default,
$multi_store = false, $multi_store = false,
$glare_enabled = false, $glare_enabled = false,
) { ) {
@ -76,9 +76,11 @@ class glance::backend::cinder(
} }
glance_api_config { glance_api_config {
'glance_store/cinder_api_insecure': value => $cinder_api_insecure; 'glance_store/cinder_api_insecure': value => $cinder_api_insecure;
'glance_store/cinder_catalog_info': value => $cinder_catalog_info; 'glance_store/cinder_catalog_info': value => $cinder_catalog_info;
'glance_store/cinder_http_retries': value => $cinder_http_retries; 'glance_store/cinder_http_retries': value => $cinder_http_retries;
'glance_store/cinder_endpoint_template': value => $cinder_endpoint_template;
'glance_store/cinder_ca_certificates_file': value => $cinder_ca_certificates_file;
} }
if !$multi_store { if !$multi_store {
@ -89,44 +91,20 @@ class glance::backend::cinder(
} }
glance_cache_config { glance_cache_config {
'glance_store/cinder_api_insecure': value => $cinder_api_insecure; 'glance_store/cinder_api_insecure': value => $cinder_api_insecure;
'glance_store/cinder_catalog_info': value => $cinder_catalog_info; 'glance_store/cinder_catalog_info': value => $cinder_catalog_info;
'glance_store/cinder_http_retries': value => $cinder_http_retries; 'glance_store/cinder_http_retries': value => $cinder_http_retries;
'glance_store/cinder_endpoint_template': value => $cinder_endpoint_template;
'glance_store/cinder_ca_certificates_file': value => $cinder_ca_certificates_file;
} }
if $glare_enabled { if $glare_enabled {
glance_glare_config { glance_glare_config {
'glance_store/cinder_api_insecure': value => $cinder_api_insecure; 'glance_store/cinder_api_insecure': value => $cinder_api_insecure;
'glance_store/cinder_catalog_info': value => $cinder_catalog_info; 'glance_store/cinder_catalog_info': value => $cinder_catalog_info;
'glance_store/cinder_http_retries': value => $cinder_http_retries; 'glance_store/cinder_http_retries': value => $cinder_http_retries;
} 'glance_store/cinder_endpoint_template': value => $cinder_endpoint_template;
} 'glance_store/cinder_ca_certificates_file': value => $cinder_ca_certificates_file;
if $cinder_endpoint_template {
glance_api_config { 'glance_store/cinder_endpoint_template': value => $cinder_endpoint_template; }
glance_cache_config { 'glance_store/cinder_endpoint_template': value => $cinder_endpoint_template; }
if $glare_enabled {
glance_glare_config { 'glance_store/cinder_endpoint_template': value => $cinder_endpoint_template; }
}
} else {
glance_api_config { 'glance_store/cinder_endpoint_template': ensure => absent; }
glance_cache_config { 'glance_store/cinder_endpoint_template': ensure => absent; }
if $glare_enabled {
glance_glare_config { 'glance_store/cinder_endpoint_template': ensure => absent; }
}
}
if $cinder_ca_certificates_file {
glance_api_config { 'glance_store/cinder_ca_certificates_file': value => $cinder_ca_certificates_file; }
glance_cache_config { 'glance_store/cinder_ca_certificates_file': value => $cinder_ca_certificates_file; }
if $glare_enabled {
glance_glare_config { 'glance_store/cinder_ca_certificates_file': value => $cinder_ca_certificates_file; }
}
} else {
glance_api_config { 'glance_store/cinder_ca_certificates_file': ensure => absent; }
glance_cache_config { 'glance_store/cinder_ca_certificates_file': ensure => absent; }
if $glare_enabled {
glance_glare_config { 'glance_store/cinder_ca_certificates_file': ensure => absent; }
} }
} }

View File

@ -6,16 +6,16 @@
# === parameters: # === parameters:
# #
# [*rbd_store_user*] # [*rbd_store_user*]
# Optional. # Optional. Default: $::os_service_default.
# #
# [*rbd_store_pool*] # [*rbd_store_pool*]
# Optional. Default:'images' # Optional. Default: $::os_service_default.
# #
# [*rbd_store_ceph_conf*] # [*rbd_store_ceph_conf*]
# Optional. Default:'/etc/ceph/ceph.conf' # Optional. Default: $::os_service_default.
# #
# [*rbd_store_chunk_size*] # [*rbd_store_chunk_size*]
# Optional. Default:'8' # Optional. Default: $::os_service_default.
# #
# [*show_image_direct_url*] # [*show_image_direct_url*]
# Optional. Enables direct COW from glance to rbd # Optional. Enables direct COW from glance to rbd
@ -30,6 +30,7 @@
# Optinal. Timeout value (in seconds) used when connecting # Optinal. Timeout value (in seconds) used when connecting
# to ceph cluster. If value <= 0, no timeout is set and # to ceph cluster. If value <= 0, no timeout is set and
# default librados value is used. # default librados value is used.
# Default: $::os_service_default.
# #
# [*multi_store*] # [*multi_store*]
# (optional) Boolean describing if multiple backends will be configured # (optional) Boolean describing if multiple backends will be configured
@ -40,13 +41,13 @@
# Defaults to false # Defaults to false
# #
class glance::backend::rbd( class glance::backend::rbd(
$rbd_store_user = undef, $rbd_store_user = $::os_service_default,
$rbd_store_ceph_conf = '/etc/ceph/ceph.conf', $rbd_store_ceph_conf = $::os_service_default,
$rbd_store_pool = 'images', $rbd_store_pool = $::os_service_default,
$rbd_store_chunk_size = '8', $rbd_store_chunk_size = $::os_service_default,
$show_image_direct_url = undef, $show_image_direct_url = undef,
$package_ensure = 'present', $package_ensure = 'present',
$rados_connect_timeout = '0', $rados_connect_timeout = $::os_service_default,
$multi_store = false, $multi_store = false,
$glare_enabled = false, $glare_enabled = false,
) { ) {

View File

@ -20,31 +20,31 @@
# [*bucket_url_format*] # [*bucket_url_format*]
# (Optional) The S3 calling format used to determine the bucket. Either # (Optional) The S3 calling format used to determine the bucket. Either
# 'subdomain' or 'path' can be used. # 'subdomain' or 'path' can be used.
# Default: 'subdomain' # Default: $::os_service_default.
# #
# [*create_bucket_on_put*] # [*create_bucket_on_put*]
# (Optional) A boolean to determine if the S3 bucket should be created on # (Optional) A boolean to determine if the S3 bucket should be created on
# upload if it does not exist or if an error should be returned to the user. # upload if it does not exist or if an error should be returned to the user.
# Default: False # Default: $::os_service_default.
# #
# [*large_object_size*] # [*large_object_size*]
# (Optional) What size, in MB, should S3 start chunking image files and do a # (Optional) What size, in MB, should S3 start chunking image files and do a
# multipart upload in S3. # multipart upload in S3.
# Default: 100 # Default: $::os_service_default.
# #
# [*large_object_chunk_size*] # [*large_object_chunk_size*]
# (Optional) What multipart upload part size, in MB, should S3 use when # (Optional) What multipart upload part size, in MB, should S3 use when
# uploading parts. The size must be greater than or equal to 5M. # uploading parts. The size must be greater than or equal to 5M.
# Default: 10 # Default: $::os_service_default.
# #
# [*object_buffer_dir*] # [*object_buffer_dir*]
# (Optional) The local directory where uploads will be staged before they are # (Optional) The local directory where uploads will be staged before they are
# transferred into S3. # transferred into S3.
# Default: undef # Default: $::os_service_default.
# #
# [*thread_pools*] # [*thread_pools*]
# (Optional) The number of thread pools to perform a multipart upload in S3. # (Optional) The number of thread pools to perform a multipart upload in S3.
# Default: 10 # Default: $::os_service_default.
# #
# [*multi_store*] # [*multi_store*]
# (optional) Boolean describing if multiple backends will be configured # (optional) Boolean describing if multiple backends will be configured
@ -65,24 +65,29 @@ class glance::backend::s3(
$secret_key, $secret_key,
$host, $host,
$bucket, $bucket,
$bucket_url_format = 'subdomain', $bucket_url_format = $::os_service_default,
$create_bucket_on_put = false, $create_bucket_on_put = $::os_service_default,
$large_object_size = 100, $large_object_size = $::os_service_default,
$large_object_chunk_size = 10, $large_object_chunk_size = $::os_service_default,
$object_buffer_dir = undef, $object_buffer_dir = $::os_service_default,
$thread_pools = 10, $thread_pools = $::os_service_default,
$multi_store = false, $multi_store = false,
$glare_enabled = false, $glare_enabled = false,
# deprecated parameters # deprecated parameters
$default_store = undef, $default_store = undef,
) { ) {
if !is_integer($large_object_chunk_size) or $large_object_chunk_size < 5 { if !is_service_default($large_object_chunk_size){
fail('glance::backend::s3::large_object_chunk_size must be an integer >= 5') if !is_integer($large_object_chunk_size) or $large_object_chunk_size < 5 {
fail('glance::backend::s3::large_object_chunk_size must be an integer >= 5')
}
} }
if !($bucket_url_format in ['subdomain', 'path']) {
fail('glance::backend::s3::bucket_url_format must be either "subdomain" or "path"') if !is_service_default($bucket_url_format){
if !($bucket_url_format in ['subdomain', 'path']) {
fail('glance::backend::s3::bucket_url_format must be either "subdomain" or "path"')
}
} }
if $default_store { if $default_store {
@ -99,6 +104,7 @@ class glance::backend::s3(
'glance_store/s3_store_large_object_size': value => $large_object_size; 'glance_store/s3_store_large_object_size': value => $large_object_size;
'glance_store/s3_store_large_object_chunk_size': value => $large_object_chunk_size; 'glance_store/s3_store_large_object_chunk_size': value => $large_object_chunk_size;
'glance_store/s3_store_thread_pools': value => $thread_pools; 'glance_store/s3_store_thread_pools': value => $thread_pools;
'glance_store/s3_store_object_buffer_dir': value => $object_buffer_dir;
} }
if $glare_enabled { if $glare_enabled {
@ -112,6 +118,7 @@ class glance::backend::s3(
'glance_store/s3_store_large_object_size': value => $large_object_size; 'glance_store/s3_store_large_object_size': value => $large_object_size;
'glance_store/s3_store_large_object_chunk_size': value => $large_object_chunk_size; 'glance_store/s3_store_large_object_chunk_size': value => $large_object_chunk_size;
'glance_store/s3_store_thread_pools': value => $thread_pools; 'glance_store/s3_store_thread_pools': value => $thread_pools;
'glance_store/s3_store_object_buffer_dir': value => $object_buffer_dir;
} }
} }
@ -122,16 +129,4 @@ class glance::backend::s3(
} }
} }
if $object_buffer_dir {
glance_api_config { 'glance_store/s3_store_object_buffer_dir': value => $object_buffer_dir; }
if $glare_enabled {
glance_glare_config { 'glance_store/s3_store_object_buffer_dir': value => $object_buffer_dir; }
}
} else {
glance_api_config { 'glance_store/s3_store_object_buffer_dir': ensure => absent; }
if $glare_enabled {
glance_glare_config { 'glance_store/s3_store_object_buffer_dir': ensure => absent; }
}
}
} }

View File

@ -21,22 +21,22 @@
# Optional. Useful when keystone auth is version 3. Default: default # Optional. Useful when keystone auth is version 3. Default: default
# #
# [*swift_store_container*] # [*swift_store_container*]
# Optional. Default: 'glance' # Optional. Default: $::os_service_default.
# #
# [*swift_store_auth_version*] # [*swift_store_auth_version*]
# Optional. Default: '2' # Optional. Default: '2'
# #
# [*swift_store_large_object_size*] # [*swift_store_large_object_size*]
# Optional. Default: '5120' # Optional. Default: $::os_service_default.
# #
# [*swift_store_create_container_on_put*] # [*swift_store_create_container_on_put*]
# Optional. Default: 'False' # Optional. Default: $::os_service_default.
# #
# [*swift_store_endpoint_type*] # [*swift_store_endpoint_type*]
# Optional. Default: 'internalURL' # Optional. Default: 'internalURL'
# #
# [*swift_store_region*] # [*swift_store_region*]
# Optional. Default: undef # Optional. Default: $::os_service_default.
# #
# [*default_swift_reference*] # [*default_swift_reference*]
# Optional. The reference to the default swift # Optional. The reference to the default swift
@ -56,14 +56,14 @@ class glance::backend::swift(
$swift_store_user, $swift_store_user,
$swift_store_key, $swift_store_key,
$swift_store_auth_address = 'http://127.0.0.1:5000/v2.0/', $swift_store_auth_address = 'http://127.0.0.1:5000/v2.0/',
$swift_store_container = 'glance', $swift_store_container = $::os_service_default,
$swift_store_auth_version = '2', $swift_store_auth_version = '2',
$swift_store_auth_project_domain_id = 'default', $swift_store_auth_project_domain_id = 'default',
$swift_store_auth_user_domain_id = 'default', $swift_store_auth_user_domain_id = 'default',
$swift_store_large_object_size = '5120', $swift_store_large_object_size = $::os_service_default,
$swift_store_create_container_on_put = false, $swift_store_create_container_on_put = $::os_service_default,
$swift_store_endpoint_type = 'internalURL', $swift_store_endpoint_type = 'internalURL',
$swift_store_region = undef, $swift_store_region = $::os_service_default,
$default_swift_reference = 'ref1', $default_swift_reference = 'ref1',
$multi_store = false, $multi_store = false,
$glare_enabled = false, $glare_enabled = false,

View File

@ -31,7 +31,7 @@
# verifying vCenter server certificate. If parameter is not set # verifying vCenter server certificate. If parameter is not set
# then system truststore is used. If parameter is set, vcenter_api_insecure # then system truststore is used. If parameter is set, vcenter_api_insecure
# value is ignored. # value is ignored.
# Defaults to undef # Defaults to $::os_service_default.
# #
# [*vcenter_host*] # [*vcenter_host*]
# (required) vCenter/ESXi Server target system. # (required) vCenter/ESXi Server target system.
@ -57,12 +57,12 @@
# [*vcenter_task_poll_interval*] # [*vcenter_task_poll_interval*]
# (optional) The interval used for polling remote tasks invoked on # (optional) The interval used for polling remote tasks invoked on
# vCenter/ESXi server. # vCenter/ESXi server.
# Defaults to '5' # Defaults to $::os_service_default.
# #
# [*vcenter_api_retry_count*] # [*vcenter_api_retry_count*]
# (optional) Number of times VMware ESX/VC server API must be retried upon # (optional) Number of times VMware ESX/VC server API must be retried upon
# connection related issues. # connection related issues.
# Defaults to '10' # Defaults to $::os_service_default.
# #
# [*multi_store*] # [*multi_store*]
# (optional) Boolean describing if multiple backends will be configured # (optional) Boolean describing if multiple backends will be configured
@ -79,10 +79,10 @@ class glance::backend::vsphere(
$vcenter_datacenter, $vcenter_datacenter,
$vcenter_datastore, $vcenter_datastore,
$vcenter_image_dir, $vcenter_image_dir,
$vcenter_ca_file = undef, $vcenter_ca_file = $::os_service_default,
$vcenter_api_insecure = 'True', $vcenter_api_insecure = 'True',
$vcenter_task_poll_interval = '5', $vcenter_task_poll_interval = $::os_service_default,
$vcenter_api_retry_count = '10', $vcenter_api_retry_count = $::os_service_default,
$multi_store = false, $multi_store = false,
$glare_enabled = false, $glare_enabled = false,
) { ) {

View File

@ -5,25 +5,27 @@
# password to connect to the rabbit_server. # password to connect to the rabbit_server.
# #
# [*rabbit_userid*] # [*rabbit_userid*]
# user to connect to the rabbit server. Optional. Defaults to 'guest' # user to connect to the rabbit server. Optional.
# Defaults to $::os_service_default.
# #
# [*rabbit_host*] # [*rabbit_host*]
# ip or hostname of the rabbit server. Optional. Defaults to 'localhost' # ip or hostname of the rabbit server. Optional.
# Defaults to $::os_service_default.
# #
# [*rabbit_hosts*] # [*rabbit_hosts*]
# (Optional) IP or hostname of the rabbits servers. # (Optional) IP or hostname of the rabbits servers.
# comma separated array (ex: ['1.0.0.10:5672','1.0.0.11:5672']) # comma separated array (ex: ['1.0.0.10:5672','1.0.0.11:5672'])
# Defaults to false. # Defaults to $::os_service_default.
# #
# [*rabbit_port*] # [*rabbit_port*]
# port of the rabbit server. Optional. Defaults to 5672. # port of the rabbit server. Optional. Defaults to $::os_service_default.
# #
# [*rabbit_virtual_host*] # [*rabbit_virtual_host*]
# virtual_host to use. Optional. Defaults to '/' # virtual_host to use. Optional. Defaults to $::os_service_default.
# #
# [*rabbit_ha_queues*] # [*rabbit_ha_queues*]
# (optional) Use HA queues in RabbitMQ (x-ha-policy: all). # (optional) Use HA queues in RabbitMQ (x-ha-policy: all).
# Defaults to undef # Defaults to $::os_service_default.
# #
# [*rabbit_heartbeat_timeout_threshold*] # [*rabbit_heartbeat_timeout_threshold*]
# (optional) Number of seconds after which the RabbitMQ broker is considered # (optional) Number of seconds after which the RabbitMQ broker is considered
@ -38,29 +40,29 @@
# check the heartbeat on RabbitMQ connection. (i.e. rabbit_heartbeat_rate=2 # check the heartbeat on RabbitMQ connection. (i.e. rabbit_heartbeat_rate=2
# when rabbit_heartbeat_timeout_threshold=60, the heartbeat will be checked # when rabbit_heartbeat_timeout_threshold=60, the heartbeat will be checked
# every 30 seconds. # every 30 seconds.
# Defaults to 2 # Defaults to $::os_service_default.
# #
# [*rabbit_use_ssl*] # [*rabbit_use_ssl*]
# (optional) Connect over SSL for RabbitMQ # (optional) Connect over SSL for RabbitMQ
# Defaults to false # Defaults to $::os_service_default.
# #
# [*kombu_ssl_ca_certs*] # [*kombu_ssl_ca_certs*]
# (optional) SSL certification authority file (valid only if SSL enabled). # (optional) SSL certification authority file (valid only if SSL enabled).
# Defaults to undef # Defaults to $::os_service_default.
# #
# [*kombu_ssl_certfile*] # [*kombu_ssl_certfile*]
# (optional) SSL cert file (valid only if SSL enabled). # (optional) SSL cert file (valid only if SSL enabled).
# Defaults to undef # Defaults to $::os_service_default.
# #
# [*kombu_ssl_keyfile*] # [*kombu_ssl_keyfile*]
# (optional) SSL key file (valid only if SSL enabled). # (optional) SSL key file (valid only if SSL enabled).
# Defaults to undef # Defaults to $::os_service_default.
# #
# [*kombu_ssl_version*] # [*kombu_ssl_version*]
# (optional) SSL version to use (valid only if SSL enabled). # (optional) SSL version to use (valid only if SSL enabled).
# Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be # Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be
# available on some distributions. # available on some distributions.
# Defaults to 'TLSv1' # Defaults to $::os_service_default.
# #
# [*kombu_reconnect_delay*] # [*kombu_reconnect_delay*]
# (optional) How long to wait before reconnecting in response to an AMQP # (optional) How long to wait before reconnecting in response to an AMQP
@ -78,34 +80,40 @@
# #
# [*amqp_durable_queues*] # [*amqp_durable_queues*]
# (Optional) Use durable queues in broker. # (Optional) Use durable queues in broker.
# Defaults to false. # Defaults to $::os_service_default.
# #
# [*notification_driver*] # [*notification_driver*]
# Notification driver to use. Defaults to 'messaging'. # Notification driver to use. Defaults to $::os_service_default.
class glance::notify::rabbitmq( class glance::notify::rabbitmq(
$rabbit_password, $rabbit_password,
$rabbit_userid = 'guest', $rabbit_userid = $::os_service_default,
$rabbit_host = 'localhost', $rabbit_host = $::os_service_default,
$rabbit_port = '5672', $rabbit_port = $::os_service_default,
$rabbit_hosts = false, $rabbit_hosts = $::os_service_default,
$rabbit_virtual_host = '/', $rabbit_virtual_host = $::os_service_default,
$rabbit_ha_queues = undef, $rabbit_ha_queues = $::os_service_default,
$rabbit_heartbeat_timeout_threshold = 0, $rabbit_heartbeat_timeout_threshold = 0,
$rabbit_heartbeat_rate = 2, $rabbit_heartbeat_rate = $::os_service_default,
$rabbit_use_ssl = false, $rabbit_use_ssl = $::os_service_default,
$kombu_ssl_ca_certs = undef, $kombu_ssl_ca_certs = $::os_service_default,
$kombu_ssl_certfile = undef, $kombu_ssl_certfile = $::os_service_default,
$kombu_ssl_keyfile = undef, $kombu_ssl_keyfile = $::os_service_default,
$kombu_ssl_version = 'TLSv1', $kombu_ssl_version = $::os_service_default,
$kombu_reconnect_delay = $::os_service_default, $kombu_reconnect_delay = $::os_service_default,
$rabbit_notification_exchange = 'glance', $rabbit_notification_exchange = 'glance',
$rabbit_notification_topic = 'notifications', $rabbit_notification_topic = 'notifications',
$rabbit_durable_queues = false, $rabbit_durable_queues = false,
$amqp_durable_queues = false, $amqp_durable_queues = $::os_service_default,
$notification_driver = 'messaging', $notification_driver = $::os_service_default,
) { ) {
if !$rabbit_use_ssl or is_service_default($rabbit_use_ssl) {
if !is_service_default($kombu_ssl_keyfile) or !is_service_default($kombu_ssl_certfile) or !is_service_default($kombu_ssl_ca_certs) {
notice('Configuration of certificates with $rabbit_use_ssl == false is a useless config')
}
}
if $rabbit_durable_queues { if $rabbit_durable_queues {
warning('The rabbit_durable_queues parameter is deprecated, use amqp_durable_queues.') warning('The rabbit_durable_queues parameter is deprecated, use amqp_durable_queues.')
$amqp_durable_queues_real = $rabbit_durable_queues $amqp_durable_queues_real = $rabbit_durable_queues
@ -113,31 +121,32 @@ class glance::notify::rabbitmq(
$amqp_durable_queues_real = $amqp_durable_queues $amqp_durable_queues_real = $amqp_durable_queues
} }
if $rabbit_hosts { if ! is_service_default($rabbit_hosts) and $rabbit_hosts {
glance_api_config { glance_api_config {
'oslo_messaging_rabbit/rabbit_hosts': value => join($rabbit_hosts, ','); 'oslo_messaging_rabbit/rabbit_hosts': value => join(any2array($rabbit_hosts), ',');
'oslo_messaging_rabbit/rabbit_host': ensure => absent;
'oslo_messaging_rabbit/rabbit_port': ensure => absent;
}
if size($rabbit_hosts) > 1 and is_service_default($rabbit_ha_queues) {
glance_api_config {
'oslo_messaging_rabbit/rabbit_ha_queues': value => true;
}
} else {
glance_api_config {
'oslo_messaging_rabbit/rabbit_ha_queues': value => $rabbit_ha_queues;
}
} }
} else { } else {
glance_api_config { glance_api_config {
'oslo_messaging_rabbit/rabbit_host': value => $rabbit_host; 'oslo_messaging_rabbit/rabbit_host': value => $rabbit_host;
'oslo_messaging_rabbit/rabbit_port': value => $rabbit_port; 'oslo_messaging_rabbit/rabbit_port': value => $rabbit_port;
'oslo_messaging_rabbit/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}"; 'oslo_messaging_rabbit/rabbit_hosts': ensure => absent;
'oslo_messaging_rabbit/rabbit_ha_queues': value => $rabbit_ha_queues;
} }
} }
# by default rabbit_ha_queues is undef
if $rabbit_ha_queues == undef {
if $rabbit_hosts {
glance_api_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
} else {
glance_api_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
}
} else {
glance_api_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $rabbit_ha_queues }
}
glance_api_config { glance_api_config {
'DEFAULT/notification_driver': value => $notification_driver; 'DEFAULT/notification_driver': value => $notification_driver;
'oslo_messaging_rabbit/rabbit_virtual_host': value => $rabbit_virtual_host; 'oslo_messaging_rabbit/rabbit_virtual_host': value => $rabbit_virtual_host;
'oslo_messaging_rabbit/rabbit_password': value => $rabbit_password, secret => true; 'oslo_messaging_rabbit/rabbit_password': value => $rabbit_password, secret => true;
'oslo_messaging_rabbit/rabbit_userid': value => $rabbit_userid; 'oslo_messaging_rabbit/rabbit_userid': value => $rabbit_userid;
@ -148,37 +157,10 @@ class glance::notify::rabbitmq(
'oslo_messaging_rabbit/kombu_reconnect_delay': value => $kombu_reconnect_delay; 'oslo_messaging_rabbit/kombu_reconnect_delay': value => $kombu_reconnect_delay;
'oslo_messaging_rabbit/rabbit_use_ssl': value => $rabbit_use_ssl; 'oslo_messaging_rabbit/rabbit_use_ssl': value => $rabbit_use_ssl;
'oslo_messaging_rabbit/amqp_durable_queues': value => $amqp_durable_queues_real; 'oslo_messaging_rabbit/amqp_durable_queues': value => $amqp_durable_queues_real;
'oslo_messaging_rabbit/kombu_ssl_version': value => $kombu_ssl_version;
'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $kombu_ssl_ca_certs;
'oslo_messaging_rabbit/kombu_ssl_certfile': value => $kombu_ssl_certfile;
'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $kombu_ssl_keyfile;
} }
if $rabbit_use_ssl {
glance_api_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $kombu_ssl_version }
if $kombu_ssl_ca_certs {
glance_api_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $kombu_ssl_ca_certs }
} else {
glance_api_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent}
}
if $kombu_ssl_certfile {
glance_api_config { 'oslo_messaging_rabbit/kombu_ssl_certfile': value => $kombu_ssl_certfile }
} else {
glance_api_config { 'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent}
}
if $kombu_ssl_keyfile {
glance_api_config { 'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $kombu_ssl_keyfile }
} else {
glance_api_config { 'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent}
}
} else {
glance_api_config {
'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
}
if ($kombu_ssl_keyfile or $kombu_ssl_certfile or $kombu_ssl_ca_certs) {
notice('Configuration of certificates with $rabbit_use_ssl == false is a useless config')
}
}
} }

View File

@ -19,7 +19,8 @@
# (optional) Enable debug logs (true|false). Defaults to undef. # (optional) Enable debug logs (true|false). Defaults to undef.
# #
# [*bind_host*] # [*bind_host*]
# (optional) The address of the host to bind to. Defaults to '0.0.0.0'. # (optional) The address of the host to bind to.
# Defaults to $::os_service_default.
# #
# [*bind_port*] # [*bind_port*]
# (optional) The port the server should bind to. Defaults to '9191'. # (optional) The port the server should bind to. Defaults to '9191'.
@ -119,15 +120,15 @@
# #
# [*cert_file*] # [*cert_file*]
# (optinal) Certificate file to use when starting registry server securely # (optinal) Certificate file to use when starting registry server securely
# Defaults to false, not set # Defaults to $::os_service_default.
# #
# [*key_file*] # [*key_file*]
# (optional) Private key file to use when starting registry server securely # (optional) Private key file to use when starting registry server securely
# Defaults to false, not set # Defaults to $::os_service_default.
# #
# [*ca_file*] # [*ca_file*]
# (optional) CA certificate file to use to verify connecting clients # (optional) CA certificate file to use to verify connecting clients
# Defaults to false, not set # Defaults to $::os_service_default.
# #
# [*sync_db*] # [*sync_db*]
# (Optional) Run db sync on the node. # (Optional) Run db sync on the node.
@ -157,7 +158,7 @@ class glance::registry(
$package_ensure = 'present', $package_ensure = 'present',
$verbose = undef, $verbose = undef,
$debug = undef, $debug = undef,
$bind_host = '0.0.0.0', $bind_host = $::os_service_default,
$bind_port = '9191', $bind_port = '9191',
$workers = $::processorcount, $workers = $::processorcount,
$log_file = undef, $log_file = undef,
@ -181,9 +182,9 @@ class glance::registry(
$manage_service = true, $manage_service = true,
$enabled = true, $enabled = true,
$purge_config = false, $purge_config = false,
$cert_file = false, $cert_file = $::os_service_default,
$key_file = false, $key_file = $::os_service_default,
$ca_file = false, $ca_file = $::os_service_default,
$sync_db = true, $sync_db = true,
$os_region_name = $::os_service_default, $os_region_name = $::os_service_default,
$signing_dir = $::os_service_default, $signing_dir = $::os_service_default,
@ -239,32 +240,10 @@ class glance::registry(
} }
# SSL Options # SSL Options
if $cert_file { glance_registry_config {
glance_registry_config { 'DEFAULT/cert_file': value => $cert_file;
'DEFAULT/cert_file' : value => $cert_file; 'DEFAULT/key_file': value => $key_file;
} 'DEFAULT/ca_file': value => $ca_file;
} else {
glance_registry_config {
'DEFAULT/cert_file': ensure => absent;
}
}
if $key_file {
glance_registry_config {
'DEFAULT/key_file' : value => $key_file;
}
} else {
glance_registry_config {
'DEFAULT/key_file': ensure => absent;
}
}
if $ca_file {
glance_registry_config {
'DEFAULT/ca_file' : value => $ca_file;
}
} else {
glance_registry_config {
'DEFAULT/ca_file': ensure => absent;
}
} }
if $sync_db { if $sync_db {

View File

@ -95,24 +95,24 @@
# Example: 'Y-%m-%d %H:%M:%S' # Example: 'Y-%m-%d %H:%M:%S'
class glance::registry::logging( class glance::registry::logging(
$use_syslog = false, $use_syslog = $::os_service_default,
$use_stderr = true, $use_stderr = $::os_service_default,
$log_facility = 'LOG_USER', $log_facility = $::os_service_default,
$log_dir = '/var/log/glance', $log_dir = '/var/log/glance',
$log_file = '/var/log/glance/registry.log', $log_file = '/var/log/glance/registry.log',
$verbose = false, $verbose = $::os_service_default,
$debug = false, $debug = $::os_service_default,
$logging_context_format_string = undef, $logging_context_format_string = $::os_service_default,
$logging_default_format_string = undef, $logging_default_format_string = $::os_service_default,
$logging_debug_format_suffix = undef, $logging_debug_format_suffix = $::os_service_default,
$logging_exception_prefix = undef, $logging_exception_prefix = $::os_service_default,
$log_config_append = undef, $log_config_append = $::os_service_default,
$default_log_levels = undef, $default_log_levels = $::os_service_default,
$publish_errors = undef, $publish_errors = $::os_service_default,
$fatal_deprecations = undef, $fatal_deprecations = $::os_service_default,
$instance_format = undef, $instance_format = $::os_service_default,
$instance_uuid_format = undef, $instance_uuid_format = $::os_service_default,
$log_date_format = undef, $log_date_format = $::os_service_default,
) { ) {
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function # NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
@ -125,140 +125,31 @@ class glance::registry::logging(
$verbose_real = pick($::glance::registry::verbose,$verbose) $verbose_real = pick($::glance::registry::verbose,$verbose)
$debug_real = pick($::glance::registry::debug,$debug) $debug_real = pick($::glance::registry::debug,$debug)
glance_registry_config { if is_service_default($default_log_levels) {
'DEFAULT/debug' : value => $debug_real; $default_log_levels_real = $default_log_levels
'DEFAULT/verbose' : value => $verbose_real; } else {
'DEFAULT/use_stderr' : value => $use_stderr_real; $default_log_levels_real = join(sort(join_keys_to_values($default_log_levels, '=')), ',')
'DEFAULT/use_syslog' : value => $use_syslog_real;
'DEFAULT/log_dir' : value => $log_dir_real;
'DEFAULT/log_file' : value => $log_file_real;
'DEFAULT/syslog_log_facility': value => $log_facility_real;
} }
if $logging_context_format_string { glance_registry_config {
glance_registry_config { 'DEFAULT/debug': value => $debug_real;
'DEFAULT/logging_context_format_string' : 'DEFAULT/verbose': value => $verbose_real;
value => $logging_context_format_string; 'DEFAULT/use_stderr': value => $use_stderr_real;
} 'DEFAULT/use_syslog': value => $use_syslog_real;
} 'DEFAULT/log_dir': value => $log_dir_real;
else { 'DEFAULT/log_file': value => $log_file_real;
glance_registry_config { 'DEFAULT/syslog_log_facility': value => $log_facility_real;
'DEFAULT/logging_context_format_string' : ensure => absent; 'DEFAULT/logging_context_format_string': value => $logging_context_format_string;
} 'DEFAULT/logging_default_format_string': value => $logging_default_format_string;
} 'DEFAULT/logging_debug_format_suffix': value => $logging_debug_format_suffix;
'DEFAULT/logging_exception_prefix': value => $logging_exception_prefix;
if $logging_default_format_string { 'DEFAULT/log_config_append': value => $log_config_append;
glance_registry_config { 'DEFAULT/default_log_levels': value => $default_log_levels_real;
'DEFAULT/logging_default_format_string' : 'DEFAULT/publish_errors': value => $publish_errors;
value => $logging_default_format_string; 'DEFAULT/fatal_deprecations': value => $fatal_deprecations;
} 'DEFAULT/instance_format': value => $instance_format;
} 'DEFAULT/instance_uuid_format': value => $instance_uuid_format;
else { 'DEFAULT/log_date_format': value => $log_date_format;
glance_registry_config { }
'DEFAULT/logging_default_format_string' : ensure => absent;
}
}
if $logging_debug_format_suffix {
glance_registry_config {
'DEFAULT/logging_debug_format_suffix' :
value => $logging_debug_format_suffix;
}
}
else {
glance_registry_config {
'DEFAULT/logging_debug_format_suffix' : ensure => absent;
}
}
if $logging_exception_prefix {
glance_registry_config {
'DEFAULT/logging_exception_prefix' : value => $logging_exception_prefix;
}
}
else {
glance_registry_config {
'DEFAULT/logging_exception_prefix' : ensure => absent;
}
}
if $log_config_append {
glance_registry_config {
'DEFAULT/log_config_append' : value => $log_config_append;
}
}
else {
glance_registry_config {
'DEFAULT/log_config_append' : ensure => absent;
}
}
if $default_log_levels {
glance_registry_config {
'DEFAULT/default_log_levels' :
value => join(sort(join_keys_to_values($default_log_levels, '=')), ',');
}
}
else {
glance_registry_config {
'DEFAULT/default_log_levels' : ensure => absent;
}
}
if $publish_errors {
glance_registry_config {
'DEFAULT/publish_errors' : value => $publish_errors;
}
}
else {
glance_registry_config {
'DEFAULT/publish_errors' : ensure => absent;
}
}
if $fatal_deprecations {
glance_registry_config {
'DEFAULT/fatal_deprecations' : value => $fatal_deprecations;
}
}
else {
glance_registry_config {
'DEFAULT/fatal_deprecations' : ensure => absent;
}
}
if $instance_format {
glance_registry_config {
'DEFAULT/instance_format' : value => $instance_format;
}
}
else {
glance_registry_config {
'DEFAULT/instance_format' : ensure => absent;
}
}
if $instance_uuid_format {
glance_registry_config {
'DEFAULT/instance_uuid_format' : value => $instance_uuid_format;
}
}
else {
glance_registry_config {
'DEFAULT/instance_uuid_format' : ensure => absent;
}
}
if $log_date_format {
glance_registry_config {
'DEFAULT/log_date_format' : value => $log_date_format;
}
}
else {
glance_registry_config {
'DEFAULT/log_date_format' : ensure => absent;
}
}
} }

View File

@ -58,12 +58,12 @@ describe 'glance::api::logging' do
shared_examples 'basic default logging settings' do shared_examples 'basic default logging settings' do
it 'configures glance logging settins with default values' do it 'configures glance logging settins with default values' do
is_expected.to contain_glance_api_config('DEFAULT/use_syslog').with(:value => 'false') is_expected.to contain_glance_api_config('DEFAULT/use_syslog').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('DEFAULT/use_stderr').with(:value => 'true') is_expected.to contain_glance_api_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('DEFAULT/log_dir').with(:value => '/var/log/glance') is_expected.to contain_glance_api_config('DEFAULT/log_dir').with(:value => '/var/log/glance')
is_expected.to contain_glance_api_config('DEFAULT/log_file').with(:value => '/var/log/glance/api.log') is_expected.to contain_glance_api_config('DEFAULT/log_file').with(:value => '/var/log/glance/api.log')
is_expected.to contain_glance_api_config('DEFAULT/verbose').with(:value => 'false') is_expected.to contain_glance_api_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('DEFAULT/debug').with(:value => 'false') is_expected.to contain_glance_api_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
end end
end end
@ -123,7 +123,7 @@ describe 'glance::api::logging' do
:default_log_levels, :fatal_deprecations, :default_log_levels, :fatal_deprecations,
:instance_format, :instance_uuid_format, :instance_format, :instance_uuid_format,
:log_date_format, ].each { |param| :log_date_format, ].each { |param|
it { is_expected.to contain_glance_api_config("DEFAULT/#{param}").with_ensure('absent') } it { is_expected.to contain_glance_api_config("DEFAULT/#{param}").with_value('<SERVICE DEFAULT>') }
} }
end end

View File

@ -6,26 +6,26 @@ describe 'glance::api' do
{ {
:verbose => false, :verbose => false,
:debug => false, :debug => false,
:use_stderr => true, :use_stderr => '<SERVICE DEFAULT>',
:bind_host => '0.0.0.0', :bind_host => '<SERVICE DEFAULT>',
:bind_port => '9292', :bind_port => '9292',
:registry_host => '0.0.0.0', :registry_host => '0.0.0.0',
:registry_port => '9191', :registry_port => '<SERVICE DEFAULT>',
:registry_client_protocol => 'http', :registry_client_protocol => '<SERVICE DEFAULT>',
:log_file => '/var/log/glance/api.log', :log_file => '/var/log/glance/api.log',
:log_dir => '/var/log/glance', :log_dir => '/var/log/glance',
:auth_type => 'keystone', :auth_type => 'keystone',
:auth_region => '<SERVICE DEFAULT>', :auth_region => '<SERVICE DEFAULT>',
:enabled => true, :enabled => true,
:manage_service => true, :manage_service => true,
:backlog => '4096', :backlog => '<SERVICE DEFAULT>',
:workers => '7', :workers => '7',
:keystone_tenant => 'services', :keystone_tenant => 'services',
:keystone_user => 'glance', :keystone_user => 'glance',
:keystone_password => 'ChangeMe', :keystone_password => 'ChangeMe',
:token_cache_time => '<SERVICE DEFAULT>', :token_cache_time => '<SERVICE DEFAULT>',
:memcached_servers => '<SERVICE DEFAULT>', :memcached_servers => '<SERVICE DEFAULT>',
:show_image_direct_url => false, :show_image_direct_url => '<SERVICE DEFAULT>',
:show_multiple_locations => '<SERVICE DEFAULT>', :show_multiple_locations => '<SERVICE DEFAULT>',
:location_strategy => '<SERVICE DEFAULT>', :location_strategy => '<SERVICE DEFAULT>',
:purge_config => false, :purge_config => false,

View File

@ -33,25 +33,25 @@ describe 'glance::backend::cinder' do
it 'configures glance-api.conf' do it 'configures glance-api.conf' do
is_expected.to contain_glance_api_config('glance_store/default_store').with_value('cinder') is_expected.to contain_glance_api_config('glance_store/default_store').with_value('cinder')
is_expected.to contain_glance_api_config('glance_store/default_store').with_value('cinder') is_expected.to contain_glance_api_config('glance_store/default_store').with_value('cinder')
is_expected.to contain_glance_api_config('glance_store/cinder_api_insecure').with_value(false) is_expected.to contain_glance_api_config('glance_store/cinder_api_insecure').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/cinder_catalog_info').with_value('volume:cinder:publicURL') is_expected.to contain_glance_api_config('glance_store/cinder_catalog_info').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/cinder_http_retries').with_value('3') is_expected.to contain_glance_api_config('glance_store/cinder_http_retries').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/cinder_ca_certificates_file').with(:ensure => 'absent') is_expected.to contain_glance_api_config('glance_store/cinder_ca_certificates_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/cinder_endpoint_template').with(:ensure => 'absent') is_expected.to contain_glance_api_config('glance_store/cinder_endpoint_template').with_value('<SERVICE DEFAULT>')
end end
it 'configures glance-cache.conf' do it 'configures glance-cache.conf' do
is_expected.to contain_glance_cache_config('glance_store/cinder_api_insecure').with_value(false) is_expected.to contain_glance_cache_config('glance_store/cinder_api_insecure').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_cache_config('glance_store/cinder_catalog_info').with_value('volume:cinder:publicURL') is_expected.to contain_glance_cache_config('glance_store/cinder_catalog_info').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_cache_config('glance_store/cinder_http_retries').with_value('3') is_expected.to contain_glance_cache_config('glance_store/cinder_http_retries').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_cache_config('glance_store/cinder_ca_certificates_file').with(:ensure => 'absent') is_expected.to contain_glance_cache_config('glance_store/cinder_ca_certificates_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_cache_config('glance_store/cinder_endpoint_template').with(:ensure => 'absent') is_expected.to contain_glance_cache_config('glance_store/cinder_endpoint_template').with_value('<SERVICE DEFAULT>')
end end
it 'not configures glance-glare.conf' do it 'not configures glance-glare.conf' do
is_expected.to_not contain_glance_glare_config('glance_store/cinder_api_insecure').with_value(false) is_expected.to_not contain_glance_glare_config('glance_store/cinder_api_insecure').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/cinder_catalog_info').with_value('volume:cinder:publicURL') is_expected.to_not contain_glance_glare_config('glance_store/cinder_catalog_info').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/cinder_http_retries').with_value('3') is_expected.to_not contain_glance_glare_config('glance_store/cinder_http_retries').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/cinder_ca_certificates_file').with(:ensure => 'absent') is_expected.to_not contain_glance_glare_config('glance_store/cinder_ca_certificates_file').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/cinder_endpoint_template').with(:ensure => 'absent') is_expected.to_not contain_glance_glare_config('glance_store/cinder_endpoint_template').with_value('<SERVICE DEFAULT>')
end end
end end

View File

@ -7,24 +7,21 @@ describe 'glance::backend::rbd' do
}) })
end end
describe 'when defaults with rbd_store_user' do describe 'with default params' do
let :params do
{
:rbd_store_user => 'glance',
}
end
it { is_expected.to contain_glance_api_config('glance_store/default_store').with_value('rbd') } it { is_expected.to contain_glance_api_config('glance_store/default_store').with_value('rbd') }
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_pool').with_value('images') } it { is_expected.to contain_glance_api_config('glance_store/rbd_store_pool').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_ceph_conf').with_value('/etc/ceph/ceph.conf') } it { is_expected.to contain_glance_api_config('glance_store/rbd_store_ceph_conf').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_chunk_size').with_value('8') } it { is_expected.to contain_glance_api_config('glance_store/rbd_store_chunk_size').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('glance_store/rados_connect_timeout').with_value('0')} it { is_expected.to contain_glance_api_config('glance_store/rados_connect_timeout').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_user').with_value('<SERVICE DEFAULT>')}
it { is_expected.to_not contain_glance_glare_config('glance_store/default_store').with_value('rbd') } it { is_expected.to_not contain_glance_glare_config('glance_store/default_store').with_value('rbd') }
it { is_expected.to_not contain_glance_glare_config('glance_store/rbd_store_pool').with_value('images') } it { is_expected.to_not contain_glance_glare_config('glance_store/rbd_store_pool').with_value('<SERVICE DEFAULT>') }
it { is_expected.to_not contain_glance_glare_config('glance_store/rbd_store_ceph_conf').with_value('/etc/ceph/ceph.conf') } it { is_expected.to_not contain_glance_glare_config('glance_store/rbd_store_ceph_conf').with_value('<SERVICE DEFAULT>') }
it { is_expected.to_not contain_glance_glare_config('glance_store/rbd_store_chunk_size').with_value('8') } it { is_expected.to_not contain_glance_glare_config('glance_store/rbd_store_chunk_size').with_value('<SERVICE DEFAULT>') }
it { is_expected.to_not contain_glance_glare_config('glance_store/rados_connect_timeout').with_value('0')} it { is_expected.to_not contain_glance_glare_config('glance_store/rados_connect_timeout').with_value('<SERVICE DEFAULT>')}
it { is_expected.to_not contain_glance_glare_config('glance_store/rbd_store_user').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_package('python-ceph').with( it { is_expected.to contain_package('python-ceph').with(
:name => 'python-ceph', :name => 'python-ceph',
:ensure => 'present' :ensure => 'present'

View File

@ -19,12 +19,12 @@ describe 'glance::backend::s3' do
is_expected.to contain_glance_api_config('glance_store/s3_store_secret_key').with_value('secret') is_expected.to contain_glance_api_config('glance_store/s3_store_secret_key').with_value('secret')
is_expected.to contain_glance_api_config('glance_store/s3_store_host').with_value('host') is_expected.to contain_glance_api_config('glance_store/s3_store_host').with_value('host')
is_expected.to contain_glance_api_config('glance_store/s3_store_bucket').with_value('bucket') is_expected.to contain_glance_api_config('glance_store/s3_store_bucket').with_value('bucket')
is_expected.to contain_glance_api_config('glance_store/s3_store_bucket_url_format').with_value('subdomain') is_expected.to contain_glance_api_config('glance_store/s3_store_bucket_url_format').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/s3_store_create_bucket_on_put').with_value('false') is_expected.to contain_glance_api_config('glance_store/s3_store_create_bucket_on_put').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/s3_store_large_object_size').with_value('100') is_expected.to contain_glance_api_config('glance_store/s3_store_large_object_size').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/s3_store_large_object_chunk_size').with_value('10') is_expected.to contain_glance_api_config('glance_store/s3_store_large_object_chunk_size').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/s3_store_object_buffer_dir').with_value(nil) is_expected.to contain_glance_api_config('glance_store/s3_store_object_buffer_dir').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/s3_store_thread_pools').with_value('10') is_expected.to contain_glance_api_config('glance_store/s3_store_thread_pools').with_value('<SERVICE DEFAULT>')
end end
it 'not configures glance-glare.conf' do it 'not configures glance-glare.conf' do
is_expected.to_not contain_glance_glare_config('glance_store/default_store').with_value('s3') is_expected.to_not contain_glance_glare_config('glance_store/default_store').with_value('s3')
@ -32,12 +32,12 @@ describe 'glance::backend::s3' do
is_expected.to_not contain_glance_glare_config('glance_store/s3_store_secret_key').with_value('secret') is_expected.to_not contain_glance_glare_config('glance_store/s3_store_secret_key').with_value('secret')
is_expected.to_not contain_glance_glare_config('glance_store/s3_store_host').with_value('host') is_expected.to_not contain_glance_glare_config('glance_store/s3_store_host').with_value('host')
is_expected.to_not contain_glance_glare_config('glance_store/s3_store_bucket').with_value('bucket') is_expected.to_not contain_glance_glare_config('glance_store/s3_store_bucket').with_value('bucket')
is_expected.to_not contain_glance_glare_config('glance_store/s3_store_bucket_url_format').with_value('subdomain') is_expected.to_not contain_glance_glare_config('glance_store/s3_store_bucket_url_format').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/s3_store_create_bucket_on_put').with_value('false') is_expected.to_not contain_glance_glare_config('glance_store/s3_store_create_bucket_on_put').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/s3_store_large_object_size').with_value('100') is_expected.to_not contain_glance_glare_config('glance_store/s3_store_large_object_size').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/s3_store_large_object_chunk_size').with_value('10') is_expected.to_not contain_glance_glare_config('glance_store/s3_store_large_object_chunk_size').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/s3_store_object_buffer_dir').with_value(nil) is_expected.to_not contain_glance_glare_config('glance_store/s3_store_object_buffer_dir').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/s3_store_thread_pools').with_value('10') is_expected.to_not contain_glance_glare_config('glance_store/s3_store_thread_pools').with_value('<SERVICE DEFAULT>')
end end
end end

View File

@ -17,11 +17,11 @@ describe 'glance::backend::swift' do
it 'configures glance-api.conf' do it 'configures glance-api.conf' do
is_expected.to contain_glance_api_config('glance_store/default_store').with_value('swift') is_expected.to contain_glance_api_config('glance_store/default_store').with_value('swift')
is_expected.to contain_glance_api_config('glance_store/swift_store_large_object_size').with_value('5120') is_expected.to contain_glance_api_config('glance_store/swift_store_large_object_size').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/swift_store_container').with_value('glance') is_expected.to contain_glance_api_config('glance_store/swift_store_container').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/swift_store_create_container_on_put').with_value(false) is_expected.to contain_glance_api_config('glance_store/swift_store_create_container_on_put').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/swift_store_endpoint_type').with_value('internalURL') is_expected.to contain_glance_api_config('glance_store/swift_store_endpoint_type').with_value('internalURL')
is_expected.to contain_glance_api_config('glance_store/swift_store_region').with_value(nil) is_expected.to contain_glance_api_config('glance_store/swift_store_region').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/swift_store_config_file').with_value('/etc/glance/glance-swift.conf') is_expected.to contain_glance_api_config('glance_store/swift_store_config_file').with_value('/etc/glance/glance-swift.conf')
is_expected.to contain_glance_api_config('glance_store/default_swift_reference').with_value('ref1') is_expected.to contain_glance_api_config('glance_store/default_swift_reference').with_value('ref1')
is_expected.to contain_glance_swift_config('ref1/key').with_value('key') is_expected.to contain_glance_swift_config('ref1/key').with_value('key')
@ -34,11 +34,11 @@ describe 'glance::backend::swift' do
it 'not configures glance-glare.conf' do it 'not configures glance-glare.conf' do
is_expected.to_not contain_glance_glare_config('glance_store/default_store').with_value('swift') is_expected.to_not contain_glance_glare_config('glance_store/default_store').with_value('swift')
is_expected.to_not contain_glance_glare_config('glance_store/swift_store_large_object_size').with_value('5120') is_expected.to_not contain_glance_glare_config('glance_store/swift_store_large_object_size').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/swift_store_container').with_value('glance') is_expected.to_not contain_glance_glare_config('glance_store/swift_store_container').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/swift_store_create_container_on_put').with_value(false) is_expected.to_not contain_glance_glare_config('glance_store/swift_store_create_container_on_put').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/swift_store_endpoint_type').with_value('internalURL') is_expected.to_not contain_glance_glare_config('glance_store/swift_store_endpoint_type').with_value('internalURL')
is_expected.to_not contain_glance_glare_config('glance_store/swift_store_region').with_value(nil) is_expected.to_not contain_glance_glare_config('glance_store/swift_store_region').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/swift_store_config_file').with_value('/etc/glance/glance-swift.conf') is_expected.to_not contain_glance_glare_config('glance_store/swift_store_config_file').with_value('/etc/glance/glance-swift.conf')
is_expected.to_not contain_glance_glare_config('glance_store/default_swift_reference').with_value('ref1') is_expected.to_not contain_glance_glare_config('glance_store/default_swift_reference').with_value('ref1')
end end

View File

@ -47,9 +47,10 @@ describe 'glance::backend::vsphere' do
is_expected.to contain_glance_api_config('glance_store/vmware_server_password').with_value('123456') is_expected.to contain_glance_api_config('glance_store/vmware_server_password').with_value('123456')
is_expected.to contain_glance_api_config('glance_store/vmware_datastore_name').with_value('Datastore') is_expected.to contain_glance_api_config('glance_store/vmware_datastore_name').with_value('Datastore')
is_expected.to contain_glance_api_config('glance_store/vmware_store_image_dir').with_value('/openstack_glance') is_expected.to contain_glance_api_config('glance_store/vmware_store_image_dir').with_value('/openstack_glance')
is_expected.to contain_glance_api_config('glance_store/vmware_task_poll_interval').with_value('5') is_expected.to contain_glance_api_config('glance_store/vmware_task_poll_interval').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/vmware_api_retry_count').with_value('10') is_expected.to contain_glance_api_config('glance_store/vmware_api_retry_count').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/vmware_datacenter_path').with_value('Datacenter') is_expected.to contain_glance_api_config('glance_store/vmware_datacenter_path').with_value('Datacenter')
is_expected.to contain_glance_api_config('glance_store/vmware_ca_file').with_value('<SERVICE DEFAULT>')
end end
it 'not configures glance-glare.conf' do it 'not configures glance-glare.conf' do
is_expected.to_not contain_glance_glare_config('glance_store/default_store').with_value('vsphere') is_expected.to_not contain_glance_glare_config('glance_store/default_store').with_value('vsphere')
@ -59,9 +60,10 @@ describe 'glance::backend::vsphere' do
is_expected.to_not contain_glance_glare_config('glance_store/vmware_server_password').with_value('123456') is_expected.to_not contain_glance_glare_config('glance_store/vmware_server_password').with_value('123456')
is_expected.to_not contain_glance_glare_config('glance_store/vmware_datastore_name').with_value('Datastore') is_expected.to_not contain_glance_glare_config('glance_store/vmware_datastore_name').with_value('Datastore')
is_expected.to_not contain_glance_glare_config('glance_store/vmware_store_image_dir').with_value('/openstack_glance') is_expected.to_not contain_glance_glare_config('glance_store/vmware_store_image_dir').with_value('/openstack_glance')
is_expected.to_not contain_glance_glare_config('glance_store/vmware_task_poll_interval').with_value('5') is_expected.to_not contain_glance_glare_config('glance_store/vmware_task_poll_interval').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/vmware_api_retry_count').with_value('10') is_expected.to_not contain_glance_glare_config('glance_store/vmware_api_retry_count').with_value('<SERVICE DEFAULT>')
is_expected.to_not contain_glance_glare_config('glance_store/vmware_datacenter_path').with_value('Datacenter') is_expected.to_not contain_glance_glare_config('glance_store/vmware_datacenter_path').with_value('Datacenter')
is_expected.to_not contain_glance_glare_config('glance_store/vmware_ca_file').with_value('<SERVICE DEFAULT>')
end end
end end

View File

@ -10,20 +10,20 @@ describe 'glance::notify::rabbitmq' do
let :params do let :params do
{:rabbit_password => 'pass'} {:rabbit_password => 'pass'}
end end
it { is_expected.to contain_glance_api_config('DEFAULT/notification_driver').with_value('messaging') } it { is_expected.to contain_glance_api_config('DEFAULT/notification_driver').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_password').with_value('pass') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_password').with_value('pass') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_password').with_value(params[:rabbit_password]).with_secret(true) } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_password').with_value(params[:rabbit_password]).with_secret(true) }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_userid').with_value('guest') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_userid').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_host').with_value('localhost') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_host').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_port').with_value('5672') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_port').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_hosts').with_value('localhost:5672') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_hosts').with_ensure('absent') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('false') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value('/') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_notification_exchange').with_value('glance') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_notification_exchange').with_value('glance') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_notification_topic').with_value('notifications') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_notification_topic').with_value('notifications') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('0') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('0') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/heartbeat_rate').with_value('2') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/heartbeat_rate').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>') }
end end
@ -42,10 +42,10 @@ describe 'glance::notify::rabbitmq' do
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_host').with_value('localhost2') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_host').with_value('localhost2') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_port').with_value('5673') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_port').with_value('5673') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_durable_queues').with_value('true') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_durable_queues').with_value('true') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('5.0') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('5.0') }
end end
@ -54,7 +54,7 @@ describe 'glance::notify::rabbitmq' do
describe 'with rabbit ssl cert parameters' do describe 'with rabbit ssl cert parameters' do
let :params do let :params do
{ {
:rabbit_password => 'pass', :rabbit_password => 'pass',
:rabbit_use_ssl => 'true', :rabbit_use_ssl => 'true',
:kombu_ssl_ca_certs => '/etc/ca.cert', :kombu_ssl_ca_certs => '/etc/ca.cert',
:kombu_ssl_certfile => '/etc/certfile', :kombu_ssl_certfile => '/etc/certfile',
@ -74,18 +74,15 @@ describe 'glance::notify::rabbitmq' do
{ {
:rabbit_password => 'pass', :rabbit_password => 'pass',
:rabbit_use_ssl => false, :rabbit_use_ssl => false,
:kombu_ssl_ca_certs => 'undef',
:kombu_ssl_certfile => 'undef',
:kombu_ssl_keyfile => 'undef',
:kombu_ssl_version => 'TLSv1', :kombu_ssl_version => 'TLSv1',
} }
end end
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1') }
end end
describe 'when passing params for single rabbit host' do describe 'when passing params for single rabbit host' do
@ -102,7 +99,7 @@ describe 'glance::notify::rabbitmq' do
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_userid').with_value('guest2') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_userid').with_value('guest2') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_host').with_value('localhost2') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_host').with_value('localhost2') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_port').with_value('5673') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_port').with_value('5673') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_hosts').with_value('localhost2:5673') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_hosts').with_ensure('absent') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('true') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('true') }
end end
@ -119,8 +116,8 @@ describe 'glance::notify::rabbitmq' do
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_hosts').with_value( it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_hosts').with_value(
'nonlocalhost3:5673,nonlocalhost4:5673') } 'nonlocalhost3:5673,nonlocalhost4:5673') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true') }
it { is_expected.to_not contain_glance_api_config('oslo_messaging_rabbit/rabbit_port') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_port').with_ensure('absent') }
it { is_expected.to_not contain_glance_api_config('oslo_messaging_rabbit/rabbit_host') } it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') }
end end
describe 'a single rabbit_host with enable ha queues' do describe 'a single rabbit_host with enable ha queues' do

View File

@ -58,12 +58,12 @@ describe 'glance::registry::logging' do
shared_examples 'basic default logging settings' do shared_examples 'basic default logging settings' do
it 'configures glance logging settins with default values' do it 'configures glance logging settins with default values' do
is_expected.to contain_glance_registry_config('DEFAULT/use_syslog').with(:value => 'false') is_expected.to contain_glance_registry_config('DEFAULT/use_syslog').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_registry_config('DEFAULT/use_stderr').with(:value => 'true') is_expected.to contain_glance_registry_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_registry_config('DEFAULT/log_dir').with(:value => '/var/log/glance') is_expected.to contain_glance_registry_config('DEFAULT/log_dir').with(:value => '/var/log/glance')
is_expected.to contain_glance_registry_config('DEFAULT/log_file').with(:value => '/var/log/glance/registry.log') is_expected.to contain_glance_registry_config('DEFAULT/log_file').with(:value => '/var/log/glance/registry.log')
is_expected.to contain_glance_registry_config('DEFAULT/verbose').with(:value => 'false') is_expected.to contain_glance_registry_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_registry_config('DEFAULT/debug').with(:value => 'false') is_expected.to contain_glance_registry_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
end end
end end
@ -123,7 +123,7 @@ describe 'glance::registry::logging' do
:default_log_levels, :fatal_deprecations, :default_log_levels, :fatal_deprecations,
:instance_format, :instance_uuid_format, :instance_format, :instance_uuid_format,
:log_date_format, ].each { |param| :log_date_format, ].each { |param|
it { is_expected.to contain_glance_registry_config("DEFAULT/#{param}").with_ensure('absent') } it { is_expected.to contain_glance_registry_config("DEFAULT/#{param}").with_value('<SERVICE DEFAULT>') }
} }
end end

View File

@ -4,8 +4,8 @@ describe 'glance::registry' do
{ {
:verbose => false, :verbose => false,
:debug => false, :debug => false,
:use_stderr => true, :use_stderr => '<SERVICE DEFAULT>',
:bind_host => '0.0.0.0', :bind_host => '<SERVICE DEFAULT>',
:bind_port => '9191', :bind_port => '9191',
:workers => facts[:processorcount], :workers => facts[:processorcount],
:log_file => '/var/log/glance/registry.log', :log_file => '/var/log/glance/registry.log',
@ -24,6 +24,9 @@ describe 'glance::registry' do
:signing_dir => '<SERVICE DEFAULT>', :signing_dir => '<SERVICE DEFAULT>',
:token_cache_time => '<SERVICE DEFAULT>', :token_cache_time => '<SERVICE DEFAULT>',
:memcached_servers => '<SERVICE DEFAULT>', :memcached_servers => '<SERVICE DEFAULT>',
:ca_file => '<SERVICE DEFAULT>',
:cert_file => '<SERVICE DEFAULT>',
:key_file => '<SERVICE DEFAULT>',
} }
end end
@ -108,6 +111,15 @@ describe 'glance::registry' do
is_expected.to contain_glance_registry_config("glance_store/#{config}").with_value(param_hash[config.intern]) is_expected.to contain_glance_registry_config("glance_store/#{config}").with_value(param_hash[config.intern])
end end
end end
it 'is_expected.to lay down default ssl config' do
[
'ca_file',
'cert_file',
'key_file',
].each do |config|
is_expected.to contain_glance_registry_config("DEFAULT/#{config}").with_value(param_hash[config.intern])
end
end
end end
end end