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

View File

@ -6,23 +6,23 @@
#
# [*verbose*]
# (Optional) Should the daemons log verbose messages
# Defaults to 'false'
# Defaults to $::os_service_default.
#
# [*debug*]
# (Optional) Should the daemons log debug messages
# Defaults to 'false'
# Defaults to $::os_service_default.
#
# [*use_syslog*]
# (Optional) Use syslog for logging.
# Defaults to 'false'
# Defaults to $::os_service_default.
#
# [*use_stderr*]
# (optional) Use stderr for logging
# Defaults to 'true'
# Defaults to $::os_service_default.
#
# [*log_facility*]
# (Optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER'
# Defaults to $::os_service_default.
#
# [*log_dir*]
# (optional) Directory where logs should be stored.
@ -35,34 +35,34 @@
#
# [*logging_context_format_string*]
# (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\
# [%(request_id)s %(user_identity)s] %(instance)s%(message)s'
#
# [*logging_default_format_string*]
# (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\
# [-] %(instance)s%(message)s'
#
# [*logging_debug_format_suffix*]
# (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'
#
# [*logging_exception_prefix*]
# (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'
#
# [*log_config_append*]
# 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
#
# [*default_log_levels*]
# (optional) Hash of logger (keys) and level (values) pairs.
# Defaults to undef.
# Defaults to $::os_service_default.
# Example:
# { 'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
# 'qpid' => 'WARN', 'sqlalchemy' => 'WARN', 'suds' => 'INFO',
@ -71,48 +71,48 @@
#
# [*publish_errors*]
# (optional) Publish error events (boolean value).
# Defaults to undef (false if unconfigured).
# Defaults to $::os_service_default.
#
# [*fatal_deprecations*]
# (optional) Make deprecations fatal (boolean value)
# Defaults to undef (false if unconfigured).
# Defaults to $::os_service_default.
#
# [*instance_format*]
# (optional) If an instance is passed with the log message, format it
# like this (string value).
# Defaults to undef.
# Defaults to $::os_service_default.
# Example: '[instance: %(uuid)s] '
#
# [*instance_uuid_format*]
# (optional) If an instance UUID is passed with the log message, format
# it like this (string value).
# Defaults to undef.
# Defaults to $::os_service_default.
# Example: instance_uuid_format='[instance: %(uuid)s] '
#
# [*log_date_format*]
# (optional) Format string for %%(asctime)s in log records.
# Defaults to undef.
# Defaults to $::os_service_default.
# Example: 'Y-%m-%d %H:%M:%S'
class glance::api::logging(
$use_syslog = false,
$use_stderr = true,
$log_facility = 'LOG_USER',
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/glance',
$log_file = '/var/log/glance/api.log',
$verbose = false,
$debug = false,
$logging_context_format_string = undef,
$logging_default_format_string = undef,
$logging_debug_format_suffix = undef,
$logging_exception_prefix = undef,
$log_config_append = undef,
$default_log_levels = undef,
$publish_errors = undef,
$fatal_deprecations = undef,
$instance_format = undef,
$instance_uuid_format = undef,
$log_date_format = undef,
$verbose = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
$logging_debug_format_suffix = $::os_service_default,
$logging_exception_prefix = $::os_service_default,
$log_config_append = $::os_service_default,
$default_log_levels = $::os_service_default,
$publish_errors = $::os_service_default,
$fatal_deprecations = $::os_service_default,
$instance_format = $::os_service_default,
$instance_uuid_format = $::os_service_default,
$log_date_format = $::os_service_default,
) {
# 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)
$debug_real = pick($::glance::api::debug,$debug)
glance_api_config {
'DEFAULT/debug' : value => $debug_real;
'DEFAULT/verbose' : value => $verbose_real;
'DEFAULT/use_stderr' : value => $use_stderr_real;
'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 is_service_default($default_log_levels) {
$default_log_levels_real = $default_log_levels
} else {
$default_log_levels_real = join(sort(join_keys_to_values($default_log_levels, '=')), ',')
}
if $logging_context_format_string {
glance_api_config {
'DEFAULT/logging_context_format_string' :
value => $logging_context_format_string;
}
}
else {
glance_api_config {
'DEFAULT/logging_context_format_string' : ensure => absent;
}
}
if $logging_default_format_string {
glance_api_config {
'DEFAULT/logging_default_format_string' :
value => $logging_default_format_string;
}
}
else {
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;
}
}
glance_api_config {
'DEFAULT/debug': value => $debug_real;
'DEFAULT/verbose': value => $verbose_real;
'DEFAULT/use_stderr': value => $use_stderr_real;
'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;
'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;
'DEFAULT/log_config_append': value => $log_config_append;
'DEFAULT/default_log_levels': value => $default_log_levels_real;
'DEFAULT/publish_errors': value => $publish_errors;
'DEFAULT/fatal_deprecations': value => $fatal_deprecations;
'DEFAULT/instance_format': value => $instance_format;
'DEFAULT/instance_uuid_format': value => $instance_uuid_format;
'DEFAULT/log_date_format': value => $log_date_format;
}
}

View File

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

View File

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

View File

@ -20,31 +20,31 @@
# [*bucket_url_format*]
# (Optional) The S3 calling format used to determine the bucket. Either
# 'subdomain' or 'path' can be used.
# Default: 'subdomain'
# Default: $::os_service_default.
#
# [*create_bucket_on_put*]
# (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.
# Default: False
# Default: $::os_service_default.
#
# [*large_object_size*]
# (Optional) What size, in MB, should S3 start chunking image files and do a
# multipart upload in S3.
# Default: 100
# Default: $::os_service_default.
#
# [*large_object_chunk_size*]
# (Optional) What multipart upload part size, in MB, should S3 use when
# uploading parts. The size must be greater than or equal to 5M.
# Default: 10
# Default: $::os_service_default.
#
# [*object_buffer_dir*]
# (Optional) The local directory where uploads will be staged before they are
# transferred into S3.
# Default: undef
# Default: $::os_service_default.
#
# [*thread_pools*]
# (Optional) The number of thread pools to perform a multipart upload in S3.
# Default: 10
# Default: $::os_service_default.
#
# [*multi_store*]
# (optional) Boolean describing if multiple backends will be configured
@ -65,24 +65,29 @@ class glance::backend::s3(
$secret_key,
$host,
$bucket,
$bucket_url_format = 'subdomain',
$create_bucket_on_put = false,
$large_object_size = 100,
$large_object_chunk_size = 10,
$object_buffer_dir = undef,
$thread_pools = 10,
$bucket_url_format = $::os_service_default,
$create_bucket_on_put = $::os_service_default,
$large_object_size = $::os_service_default,
$large_object_chunk_size = $::os_service_default,
$object_buffer_dir = $::os_service_default,
$thread_pools = $::os_service_default,
$multi_store = false,
$glare_enabled = false,
# deprecated parameters
$default_store = undef,
) {
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 !is_service_default($large_object_chunk_size){
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 {
@ -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_chunk_size': value => $large_object_chunk_size;
'glance_store/s3_store_thread_pools': value => $thread_pools;
'glance_store/s3_store_object_buffer_dir': value => $object_buffer_dir;
}
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_chunk_size': value => $large_object_chunk_size;
'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
#
# [*swift_store_container*]
# Optional. Default: 'glance'
# Optional. Default: $::os_service_default.
#
# [*swift_store_auth_version*]
# Optional. Default: '2'
#
# [*swift_store_large_object_size*]
# Optional. Default: '5120'
# Optional. Default: $::os_service_default.
#
# [*swift_store_create_container_on_put*]
# Optional. Default: 'False'
# Optional. Default: $::os_service_default.
#
# [*swift_store_endpoint_type*]
# Optional. Default: 'internalURL'
#
# [*swift_store_region*]
# Optional. Default: undef
# Optional. Default: $::os_service_default.
#
# [*default_swift_reference*]
# Optional. The reference to the default swift
@ -56,14 +56,14 @@ class glance::backend::swift(
$swift_store_user,
$swift_store_key,
$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_project_domain_id = 'default',
$swift_store_auth_user_domain_id = 'default',
$swift_store_large_object_size = '5120',
$swift_store_create_container_on_put = false,
$swift_store_large_object_size = $::os_service_default,
$swift_store_create_container_on_put = $::os_service_default,
$swift_store_endpoint_type = 'internalURL',
$swift_store_region = undef,
$swift_store_region = $::os_service_default,
$default_swift_reference = 'ref1',
$multi_store = false,
$glare_enabled = false,

View File

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

View File

@ -5,25 +5,27 @@
# password to connect to the rabbit_server.
#
# [*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*]
# 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*]
# (Optional) IP or hostname of the rabbits servers.
# comma separated array (ex: ['1.0.0.10:5672','1.0.0.11:5672'])
# Defaults to false.
# Defaults to $::os_service_default.
#
# [*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*]
# virtual_host to use. Optional. Defaults to '/'
# virtual_host to use. Optional. Defaults to $::os_service_default.
#
# [*rabbit_ha_queues*]
# (optional) Use HA queues in RabbitMQ (x-ha-policy: all).
# Defaults to undef
# Defaults to $::os_service_default.
#
# [*rabbit_heartbeat_timeout_threshold*]
# (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
# when rabbit_heartbeat_timeout_threshold=60, the heartbeat will be checked
# every 30 seconds.
# Defaults to 2
# Defaults to $::os_service_default.
#
# [*rabbit_use_ssl*]
# (optional) Connect over SSL for RabbitMQ
# Defaults to false
# Defaults to $::os_service_default.
#
# [*kombu_ssl_ca_certs*]
# (optional) SSL certification authority file (valid only if SSL enabled).
# Defaults to undef
# Defaults to $::os_service_default.
#
# [*kombu_ssl_certfile*]
# (optional) SSL cert file (valid only if SSL enabled).
# Defaults to undef
# Defaults to $::os_service_default.
#
# [*kombu_ssl_keyfile*]
# (optional) SSL key file (valid only if SSL enabled).
# Defaults to undef
# Defaults to $::os_service_default.
#
# [*kombu_ssl_version*]
# (optional) SSL version to use (valid only if SSL enabled).
# Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be
# available on some distributions.
# Defaults to 'TLSv1'
# Defaults to $::os_service_default.
#
# [*kombu_reconnect_delay*]
# (optional) How long to wait before reconnecting in response to an AMQP
@ -78,34 +80,40 @@
#
# [*amqp_durable_queues*]
# (Optional) Use durable queues in broker.
# Defaults to false.
# Defaults to $::os_service_default.
#
# [*notification_driver*]
# Notification driver to use. Defaults to 'messaging'.
# Notification driver to use. Defaults to $::os_service_default.
class glance::notify::rabbitmq(
$rabbit_password,
$rabbit_userid = 'guest',
$rabbit_host = 'localhost',
$rabbit_port = '5672',
$rabbit_hosts = false,
$rabbit_virtual_host = '/',
$rabbit_ha_queues = undef,
$rabbit_userid = $::os_service_default,
$rabbit_host = $::os_service_default,
$rabbit_port = $::os_service_default,
$rabbit_hosts = $::os_service_default,
$rabbit_virtual_host = $::os_service_default,
$rabbit_ha_queues = $::os_service_default,
$rabbit_heartbeat_timeout_threshold = 0,
$rabbit_heartbeat_rate = 2,
$rabbit_use_ssl = false,
$kombu_ssl_ca_certs = undef,
$kombu_ssl_certfile = undef,
$kombu_ssl_keyfile = undef,
$kombu_ssl_version = 'TLSv1',
$rabbit_heartbeat_rate = $::os_service_default,
$rabbit_use_ssl = $::os_service_default,
$kombu_ssl_ca_certs = $::os_service_default,
$kombu_ssl_certfile = $::os_service_default,
$kombu_ssl_keyfile = $::os_service_default,
$kombu_ssl_version = $::os_service_default,
$kombu_reconnect_delay = $::os_service_default,
$rabbit_notification_exchange = 'glance',
$rabbit_notification_topic = 'notifications',
$rabbit_durable_queues = false,
$amqp_durable_queues = false,
$notification_driver = 'messaging',
$amqp_durable_queues = $::os_service_default,
$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 {
warning('The rabbit_durable_queues parameter is deprecated, use amqp_durable_queues.')
$amqp_durable_queues_real = $rabbit_durable_queues
@ -113,31 +121,32 @@ class glance::notify::rabbitmq(
$amqp_durable_queues_real = $amqp_durable_queues
}
if $rabbit_hosts {
if ! is_service_default($rabbit_hosts) and $rabbit_hosts {
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 {
glance_api_config {
'oslo_messaging_rabbit/rabbit_host': value => $rabbit_host;
'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 {
'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_password': value => $rabbit_password, secret => true;
'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/rabbit_use_ssl': value => $rabbit_use_ssl;
'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.
#
# [*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*]
# (optional) The port the server should bind to. Defaults to '9191'.
@ -119,15 +120,15 @@
#
# [*cert_file*]
# (optinal) Certificate file to use when starting registry server securely
# Defaults to false, not set
# Defaults to $::os_service_default.
#
# [*key_file*]
# (optional) Private key file to use when starting registry server securely
# Defaults to false, not set
# Defaults to $::os_service_default.
#
# [*ca_file*]
# (optional) CA certificate file to use to verify connecting clients
# Defaults to false, not set
# Defaults to $::os_service_default.
#
# [*sync_db*]
# (Optional) Run db sync on the node.
@ -157,7 +158,7 @@ class glance::registry(
$package_ensure = 'present',
$verbose = undef,
$debug = undef,
$bind_host = '0.0.0.0',
$bind_host = $::os_service_default,
$bind_port = '9191',
$workers = $::processorcount,
$log_file = undef,
@ -181,9 +182,9 @@ class glance::registry(
$manage_service = true,
$enabled = true,
$purge_config = false,
$cert_file = false,
$key_file = false,
$ca_file = false,
$cert_file = $::os_service_default,
$key_file = $::os_service_default,
$ca_file = $::os_service_default,
$sync_db = true,
$os_region_name = $::os_service_default,
$signing_dir = $::os_service_default,
@ -239,32 +240,10 @@ class glance::registry(
}
# SSL Options
if $cert_file {
glance_registry_config {
'DEFAULT/cert_file' : value => $cert_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;
}
glance_registry_config {
'DEFAULT/cert_file': value => $cert_file;
'DEFAULT/key_file': value => $key_file;
'DEFAULT/ca_file': value => $ca_file;
}
if $sync_db {

View File

@ -95,24 +95,24 @@
# Example: 'Y-%m-%d %H:%M:%S'
class glance::registry::logging(
$use_syslog = false,
$use_stderr = true,
$log_facility = 'LOG_USER',
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/glance',
$log_file = '/var/log/glance/registry.log',
$verbose = false,
$debug = false,
$logging_context_format_string = undef,
$logging_default_format_string = undef,
$logging_debug_format_suffix = undef,
$logging_exception_prefix = undef,
$log_config_append = undef,
$default_log_levels = undef,
$publish_errors = undef,
$fatal_deprecations = undef,
$instance_format = undef,
$instance_uuid_format = undef,
$log_date_format = undef,
$verbose = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
$logging_debug_format_suffix = $::os_service_default,
$logging_exception_prefix = $::os_service_default,
$log_config_append = $::os_service_default,
$default_log_levels = $::os_service_default,
$publish_errors = $::os_service_default,
$fatal_deprecations = $::os_service_default,
$instance_format = $::os_service_default,
$instance_uuid_format = $::os_service_default,
$log_date_format = $::os_service_default,
) {
# 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)
$debug_real = pick($::glance::registry::debug,$debug)
glance_registry_config {
'DEFAULT/debug' : value => $debug_real;
'DEFAULT/verbose' : value => $verbose_real;
'DEFAULT/use_stderr' : value => $use_stderr_real;
'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 is_service_default($default_log_levels) {
$default_log_levels_real = $default_log_levels
} else {
$default_log_levels_real = join(sort(join_keys_to_values($default_log_levels, '=')), ',')
}
if $logging_context_format_string {
glance_registry_config {
'DEFAULT/logging_context_format_string' :
value => $logging_context_format_string;
}
}
else {
glance_registry_config {
'DEFAULT/logging_context_format_string' : ensure => absent;
}
}
if $logging_default_format_string {
glance_registry_config {
'DEFAULT/logging_default_format_string' :
value => $logging_default_format_string;
}
}
else {
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;
}
}
glance_registry_config {
'DEFAULT/debug': value => $debug_real;
'DEFAULT/verbose': value => $verbose_real;
'DEFAULT/use_stderr': value => $use_stderr_real;
'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;
'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;
'DEFAULT/log_config_append': value => $log_config_append;
'DEFAULT/default_log_levels': value => $default_log_levels_real;
'DEFAULT/publish_errors': value => $publish_errors;
'DEFAULT/fatal_deprecations': value => $fatal_deprecations;
'DEFAULT/instance_format': value => $instance_format;
'DEFAULT/instance_uuid_format': value => $instance_uuid_format;
'DEFAULT/log_date_format': value => $log_date_format;
}
}

View File

@ -58,12 +58,12 @@ describe 'glance::api::logging' do
shared_examples 'basic default logging settings' 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_stderr').with(:value => 'true')
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 => '<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_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/debug').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 => '<SERVICE DEFAULT>')
end
end
@ -123,7 +123,7 @@ describe 'glance::api::logging' do
:default_log_levels, :fatal_deprecations,
:instance_format, :instance_uuid_format,
: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

View File

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

View File

@ -33,25 +33,25 @@ describe 'glance::backend::cinder' 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/cinder_api_insecure').with_value(false)
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_http_retries').with_value('3')
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_endpoint_template').with(:ensure => 'absent')
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('<SERVICE DEFAULT>')
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_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/cinder_endpoint_template').with_value('<SERVICE DEFAULT>')
end
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_catalog_info').with_value('volume:cinder:publicURL')
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_ca_certificates_file').with(:ensure => 'absent')
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_api_insecure').with_value('<SERVICE DEFAULT>')
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('<SERVICE DEFAULT>')
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_value('<SERVICE DEFAULT>')
end
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_catalog_info').with_value('volume:cinder:publicURL')
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_ca_certificates_file').with(:ensure => 'absent')
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_api_insecure').with_value('<SERVICE DEFAULT>')
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('<SERVICE DEFAULT>')
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_value('<SERVICE DEFAULT>')
end
end

View File

@ -7,24 +7,21 @@ describe 'glance::backend::rbd' do
})
end
describe 'when defaults with rbd_store_user' do
let :params do
{
:rbd_store_user => 'glance',
}
end
describe 'with default params' do
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_ceph_conf').with_value('/etc/ceph/ceph.conf') }
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/rados_connect_timeout').with_value('0')}
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('<SERVICE DEFAULT>') }
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('<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/rbd_store_pool').with_value('images') }
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_chunk_size').with_value('8') }
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/rbd_store_pool').with_value('<SERVICE DEFAULT>') }
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('<SERVICE DEFAULT>') }
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(
:name => 'python-ceph',
: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_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_url_format').with_value('subdomain')
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_large_object_size').with_value('100')
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_object_buffer_dir').with_value(nil)
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_bucket_url_format').with_value('<SERVICE DEFAULT>')
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('<SERVICE DEFAULT>')
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('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/s3_store_thread_pools').with_value('<SERVICE DEFAULT>')
end
it 'not configures glance-glare.conf' do
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