]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/nova/lib/puppet/type/nova_cells.rb
77098f1e95e5b17bacc491ac2b5d23303239ece0
[dsa-puppet.git] / 3rdparty / modules / nova / lib / puppet / type / nova_cells.rb
1 #
2 # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
3 #
4 # Author: Emilien Macchi <emilien.macchi@enovance.com>
5 #         François Charlier <francois.charlier@enovance.com>
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License"); you may
8 # not use this file except in compliance with the License. You may obtain
9 # a copy of the License at
10 #
11 #      http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 # License for the specific language governing permissions and limitations
17 # under the License.
18 #
19 #
20 # nova_cells type
21 #
22 # == Parameters
23 #  [*name*]
24 #    Name for the new cell
25 #    Optional
26 #
27 #  [*cell_type*]
28 #    Whether the cell is a 'parent' or 'child'
29 #    Required
30 #
31 #  [*rabbit_username*]
32 #    Username for the message broker in this cell
33 #    Optional
34 #
35 #  [*rabbit_password*]
36 #    Password for the message broker in this cell
37 #    Optional
38 #
39 #  [*rabbit_hosts*]
40 #    Address of the message broker in this cell
41 #    Optional
42 #
43 #  [*rabbit_port*]
44 #    Port number of the message broker in this cell
45 #    Optional
46 #
47 #  [*rabbit_virtual_host*]
48 #    The virtual host of the message broker in this cell
49 #    Optional
50 #
51 #  [*weight_offset*]
52 #    It might be used by some cell scheduling code in the future
53 #    Optional
54 #
55 #  [*weight_scale*]
56 #    It might be used by some cell scheduling code in the future
57 #    Optional
58 #
59
60 Puppet::Type.newtype(:nova_cells) do
61
62   @doc = "Manage creation/deletion of nova cells."
63
64   ensurable
65
66   newparam(:name) do
67     desc "Name for the new cell"
68     defaultto "api"
69   end
70
71   newparam(:cell_type) do
72     desc 'Whether the cell is a parent or child'
73   end
74
75   newparam(:rabbit_username) do
76     desc 'Username for the message broker in this cell'
77     defaultto "guest"
78   end
79
80   newparam(:rabbit_password) do
81     desc 'Password for the message broker in this cell'
82     defaultto "guest"
83   end
84
85   newparam(:rabbit_port) do
86     desc 'Port number for the message broker in this cell'
87     defaultto "5672"
88   end
89
90   newparam(:rabbit_hosts) do
91     desc 'Address of the message broker in this cell'
92     defaultto "localhost"
93   end
94
95   newparam(:rabbit_virtual_host) do
96     desc 'The virtual host of the message broker in this cell'
97     defaultto "/"
98   end
99
100   newparam(:weight_offset) do
101     desc 'It might be used by some cell scheduling code in the future'
102     defaultto "1.0"
103   end
104
105   newparam(:weight_scale) do
106     desc 'It might be used by some cell scheduling code in the future'
107     defaultto "1.0"
108   end
109
110
111   validate do
112     raise(Puppet::Error, 'Cell type must be set') unless self[:cell_type]
113   end
114
115 end