try again, with puppetforge modules, correctly included now
[mirror/dsa-puppet.git] / 3rdparty / modules / cinder / manifests / glance.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: cinder::glance
19 #
20 # Glance drive Cinder as a block storage backend to store image data.
21 #
22 # === Parameters
23 #
24 # [*glance_api_servers*]
25 #   (optional) A list of the glance api servers available to cinder.
26 #   Should be an array with [hostname|ip]:port
27 #   Defaults to undef
28 #
29 # [*glance_api_version*]
30 #   (optional) Glance API version.
31 #   Should be 1 or 2
32 #   Defaults to 2 (current version)
33 #
34 # [*glance_num_retries*]
35 #   (optional) Number retries when downloading an image from glance.
36 #   Defaults to 0
37 #
38 # [*glance_api_insecure*]
39 #   (optional) Allow to perform insecure SSL (https) requests to glance.
40 #   Defaults to false
41 #
42 # [*glance_api_ssl_compression*]
43 #   (optional) Whether to attempt to negotiate SSL layer compression when
44 #   using SSL (https) requests. Set to False to disable SSL
45 #   layer compression. In some cases disabling this may improve
46 #   data throughput, eg when high network bandwidth is available
47 #   and you are using already compressed image formats such as qcow2.
48 #   Defaults to false
49 #
50 # [*glance_request_timeout*]
51 #   (optional) http/https timeout value for glance operations.
52 #   Defaults to undef
53 #
54
55 class cinder::glance (
56   $glance_api_servers         = undef,
57   $glance_api_version         = '2',
58   $glance_num_retries         = '0',
59   $glance_api_insecure        = false,
60   $glance_api_ssl_compression = false,
61   $glance_request_timeout     = undef
62 ) {
63
64   if is_array($glance_api_servers) {
65     cinder_config {
66       'DEFAULT/glance_api_servers': value => join($glance_api_servers, ',');
67     }
68   } elsif is_string($glance_api_servers) {
69     cinder_config {
70       'DEFAULT/glance_api_servers': value => $glance_api_servers;
71     }
72   }
73
74   cinder_config {
75     'DEFAULT/glance_api_version':         value => $glance_api_version;
76     'DEFAULT/glance_num_retries':         value => $glance_num_retries;
77     'DEFAULT/glance_api_insecure':        value => $glance_api_insecure;
78     'DEFAULT/glance_api_ssl_compression': value => $glance_api_ssl_compression;
79     'DEFAULT/glance_request_timeout':     value => $glance_request_timeout;
80   }
81
82 }