try again, with puppetforge modules, correctly included now
[mirror/dsa-puppet.git] / 3rdparty / modules / glance / manifests / backend / vsphere.pp
1 #
2 # Copyright (C) 2014 Mirantis
3 #
4 # Author: Steapn Rogov <srogov@mirantis.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::vsphere
19 #
20 # Setup Glance to backend images into VMWare vCenter/ESXi
21 #
22 # === Parameters
23 #
24 # [*vcenter_api_insecure*]
25 #   (optional) Allow to perform insecure SSL requests to vCenter/ESXi.
26 #   Should be a valid string boolean value
27 #   Defaults to 'False'
28 #
29 # [*vcenter_host*]
30 #   (required) vCenter/ESXi Server target system.
31 #   Should be a valid an IP address or a DNS name.
32 #
33 # [*vcenter_user*]
34 #   (required) Username for authenticating with vCenter/ESXi server.
35 #
36 # [*vcenter_password*]
37 #   (required) Password for authenticating with vCenter/ESXi server.
38 #
39 # [*vcenter_datacenter*]
40 #   (required) Inventory path to a datacenter.
41 #   If you want to use ESXi host as datastore,it should be "ha-datacenter".
42 #
43 # [*vcenter_datastore*]
44 #   (required) Datastore associated with the datacenter.
45 #
46 # [*vcenter_image_dir*]
47 #   (required) The name of the directory where the glance images will be stored
48 #   in the VMware datastore.
49 #
50 # [*vcenter_task_poll_interval*]
51 #   (optional) The interval used for polling remote tasks invoked on
52 #   vCenter/ESXi server.
53 #   Defaults to '5'
54 #
55 # [*vcenter_api_retry_count*]
56 #   (optional) Number of times VMware ESX/VC server API must be retried upon
57 #   connection related issues.
58 #    Defaults to '10'
59 #
60 class glance::backend::vsphere(
61   $vcenter_host,
62   $vcenter_user,
63   $vcenter_password,
64   $vcenter_datacenter,
65   $vcenter_datastore,
66   $vcenter_image_dir,
67   $vcenter_api_insecure = 'False',
68   $vcenter_task_poll_interval = '5',
69   $vcenter_api_retry_count = '10',
70 ) {
71   glance_api_config {
72     'DEFAULT/default_store': value             => 'vsphere';
73     'DEFAULT/vmware_api_insecure': value       => $vcenter_api_insecure;
74     'DEFAULT/vmware_server_host': value        => $vcenter_host;
75     'DEFAULT/vmware_server_username': value    => $vcenter_user;
76     'DEFAULT/vmware_server_password': value    => $vcenter_password;
77     'DEFAULT/vmware_datastore_name': value     => $vcenter_datastore;
78     'DEFAULT/vmware_store_image_dir': value    => $vcenter_image_dir;
79     'DEFAULT/vmware_task_poll_interval': value => $vcenter_task_poll_interval;
80     'DEFAULT/vmware_api_retry_count': value    => $vcenter_api_retry_count;
81     'DEFAULT/vmware_datacenter_path': value    => $vcenter_datacenter;
82   }
83 }