2 # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
4 # Author: Emilien Macchi <emilien.macchi@enovance.com>
6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
7 # not use this file except in compliance with the License. You may obtain
8 # a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 # License for the specific language governing permissions and limitations
18 # == Class: glance::backend::cinder
20 # Setup Glance to backend images into Cinder
24 # [*cinder_catalog_info*]
25 # (optional) Info to match when looking for cinder in the service catalog.
26 # Format is : separated values of the form:
27 # <service_type>:<service_name>:<endpoint_type> (string value)
28 # Defaults to 'volume:cinder:publicURL'
30 # [*cinder_endpoint_template*]
31 # (optional) Override service catalog lookup with template for cinder endpoint.
32 # Should be a valid URL. Example: 'http://localhost:8776/v1/%(project_id)s'
36 # (optional) The os_region_name parameter is deprecated and has no effect.
37 # Use glance::api::os_region_name instead.
40 # [*cinder_ca_certificates_file*]
41 # (optional) Location of ca certicate file to use for cinder client requests.
42 # Should be a valid ca certicate file
45 # [*cinder_http_retries*]
46 # (optional) Number of cinderclient retries on failed http calls.
47 # Should be a valid integer
50 # [*cinder_api_insecure*]
51 # (optional) Allow to perform insecure SSL requests to cinder.
52 # Should be a valid boolean value
56 class glance::backend::cinder(
57 $os_region_name = undef,
58 $cinder_ca_certificates_file = undef,
59 $cinder_api_insecure = false,
60 $cinder_catalog_info = 'volume:cinder:publicURL',
61 $cinder_endpoint_template = undef,
62 $cinder_http_retries = '3'
67 notice('The os_region_name parameter is deprecated and has no effect. Use glance::api::os_region_name instead.')
71 'DEFAULT/cinder_api_insecure': value => $cinder_api_insecure;
72 'DEFAULT/cinder_catalog_info': value => $cinder_catalog_info;
73 'DEFAULT/cinder_http_retries': value => $cinder_http_retries;
74 'glance_store/default_store': value => 'cinder';
78 'DEFAULT/cinder_api_insecure': value => $cinder_api_insecure;
79 'DEFAULT/cinder_catalog_info': value => $cinder_catalog_info;
80 'DEFAULT/cinder_http_retries': value => $cinder_http_retries;
83 if $cinder_endpoint_template {
84 glance_api_config { 'DEFAULT/cinder_endpoint_template': value => $cinder_endpoint_template; }
85 glance_cache_config { 'DEFAULT/cinder_endpoint_template': value => $cinder_endpoint_template; }
87 glance_api_config { 'DEFAULT/cinder_endpoint_template': ensure => absent; }
88 glance_cache_config { 'DEFAULT/cinder_endpoint_template': ensure => absent; }
91 if $cinder_ca_certificates_file {
92 glance_api_config { 'DEFAULT/cinder_ca_certificates_file': value => $cinder_ca_certificates_file; }
93 glance_cache_config { 'DEFAULT/cinder_ca_certificates_file': value => $cinder_ca_certificates_file; }
95 glance_api_config { 'DEFAULT/cinder_ca_certificates_file': ensure => absent; }
96 glance_cache_config { 'DEFAULT/cinder_ca_certificates_file': ensure => absent; }