Files
puppet-glance/manifests/backend/cinder.pp
Alan Bishop 69c10c4444 Update the method of configuring glance backends
This patch updates the method of configuring glance backends to use the
modern syntax associated with glance's Multi Store feature. Glance's
glance_store/stores and glance_store/default_store parameters were
deprecated in Rocky, and are scheduled for removal in Ussuri.

Backends are now specified using new glance::api::enabled_backends and
glance::api::default_backend parameters. A series of
glance::backend::multistore::* defined resources support configuring
multiple instances of each backend.

The legacy glance::api::stores and glance::api::default_store parameters,
as well as the glance::backend::* class resources, are deprecated, but
continue to function for backward compatibility.

The glance::backend::s3 class is completely deprecated. Glance removed
support for the s3 backend in Newton.

Closes-Bug: #1846808
Change-Id: I4f3ec9ee7c4147a4e62de961a9532bdc45526f6b
(cherry picked from commit fd02761c6e)
2019-11-22 10:42:06 -08:00

114 lines
4.2 KiB
Puppet

#
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Emilien Macchi <emilien.macchi@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# == Class: glance::backend::cinder
#
# Setup Glance to backend images into Cinder
#
# === Parameters
#
# [*cinder_catalog_info*]
# (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 $::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 $::os_service_default.
#
# [*os_region_name*]
# (optional) The os_region_name parameter is deprecated and has no effect.
# Use glance::api::os_region_name instead.
# Defaults to 'undef'
#
# [*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 $::os_service_default.
#
# [*cinder_http_retries*]
# (optional) Number of cinderclient retries on failed http calls.
# Should be a valid integer
# 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 $::os_service_default.
#
# [*cinder_store_auth_address*]
# (optional) A valid authentication service address.
# Defaults to $::os_service_default.
#
# [*cinder_store_project_name*]
# (optional) Project name where the image volume is stored in cinder.
# Defaults to $::os_service_default.
#
# [*cinder_store_user_name*]
# (optional) User name to authenticate against cinder.
# Defaults to $::os_service_default.
#
# [*cinder_store_password*]
# (optional) A valid password for the user specified by `cinder_store_user_name'
# Defaults to $::os_service_default.
#
# [*multi_store*]
# (optional) Boolean describing if multiple backends will be configured
# Defaults to false
#
class glance::backend::cinder(
$os_region_name = undef,
$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,
$cinder_store_auth_address = $::os_service_default,
$cinder_store_project_name = $::os_service_default,
$cinder_store_user_name = $::os_service_default,
$cinder_store_password = $::os_service_default,
$multi_store = false,
) {
include ::glance::deps
warning('glance::backend::cinder is deprecated. Use glance::backend::multistore::cinder instead.')
if $os_region_name {
notice('The os_region_name parameter is deprecated and has no effect. Use glance::api::os_region_name instead.')
}
glance::backend::multistore::cinder { 'glance_store':
cinder_api_insecure => $cinder_api_insecure,
cinder_catalog_info => $cinder_catalog_info,
cinder_http_retries => $cinder_http_retries,
cinder_endpoint_template => $cinder_endpoint_template,
cinder_ca_certificates_file => $cinder_ca_certificates_file,
cinder_store_auth_address => $cinder_store_auth_address,
cinder_store_project_name => $cinder_store_project_name,
cinder_store_user_name => $cinder_store_user_name,
cinder_store_password => $cinder_store_password,
store_description => undef,
}
if !$multi_store {
glance_api_config { 'glance_store/default_store': value => 'cinder'; }
}
}