]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/glance/manifests/backend/cinder.pp
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / glance / manifests / backend / cinder.pp
1 #
2 # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
3 #
4 # Author: Emilien Macchi <emilien.macchi@enovance.com>
5 #
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
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
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
16 # under the License.
17 #
18 # == Class: glance::backend::cinder
19 #
20 # Setup Glance to backend images into Cinder
21 #
22 # === Parameters
23 #
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'
29 #
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'
33 #   Defaults to 'undef'
34 #
35 # [*os_region_name*]
36 #   (optional) The os_region_name parameter is deprecated and has no effect.
37 #   Use glance::api::os_region_name instead.
38 #   Defaults to 'undef'
39 #
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
43 #   Defaults to undef
44 #
45 # [*cinder_http_retries*]
46 #   (optional) Number of cinderclient retries on failed http calls.
47 #   Should be a valid integer
48 #   Defaults to '3'
49 #
50 # [*cinder_api_insecure*]
51 #   (optional) Allow to perform insecure SSL requests to cinder.
52 #   Should be a valid boolean value
53 #   Defaults to false
54 #
55
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'
63
64 ) {
65
66   if $os_region_name {
67     notice('The os_region_name parameter is deprecated and has no effect. Use glance::api::os_region_name instead.')
68   }
69
70   glance_api_config {
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';
75   }
76
77   glance_cache_config {
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;
81   }
82
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; }
86   } else {
87     glance_api_config { 'DEFAULT/cinder_endpoint_template':   ensure => absent; }
88     glance_cache_config { 'DEFAULT/cinder_endpoint_template': ensure => absent; }
89   }
90
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; }
94   } else {
95     glance_api_config { 'DEFAULT/cinder_ca_certificates_file':   ensure => absent; }
96     glance_cache_config { 'DEFAULT/cinder_ca_certificates_file': ensure => absent; }
97   }
98
99 }