memcached (openstack) is no longer in use
[mirror/dsa-puppet.git] / 3rdparty / modules / nova / manifests / manage / cells.pp
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 # Configuring the database in each cell
21 # == Namevar
22 #  The namevar will be the name of the cell
23 #
24 # == Parameters
25 #  [*cell_type*]
26 #    (optional) Whether the cell is a 'parent' or 'child'
27 #    Defaults to 'parent'
28 #
29 #  [*cell_parent_name*]
30 #    (optional) If a child cell, this is the name of the 'parent' cell.
31 #    If a parent cell, should be left to undef.
32 #    Defaults to undef
33 #
34 #  [*rabbit_username*]
35 #    (optional) Username for the message broker in this cell
36 #    Defaults to 'guest'
37 #
38 #  [*rabbit_password*]
39 #    (optional) Password for the message broker in this cell
40 #    Defaults to 'guest'
41 #
42 #  [*rabbit_hosts*]
43 #    (optional) Address of the message broker in this cell
44 #    Defaults to 'localhost'
45 #
46 #  [*rabbit_port*]
47 #    (optional) Port number of the message broker in this cell
48 #    Defaults to '5672'
49 #
50 #  [*rabbit_virtual_host*]
51 #    (optional) The virtual host of the message broker in this cell
52 #    Defaults to '/'
53 #
54 #  [*weight_offset*]
55 #    (optional) It might be used by some cell scheduling code in the future
56 #    Defaults to '1.0'
57 #
58 #  [*weight_scale*]
59 #    (optional) It might be used by some cell scheduling code in the future
60 #    Defaults to '1.0'
61 #
62 define nova::manage::cells (
63   $cell_type           = 'parent',
64   $cell_parent_name    = undef,
65   $rabbit_username     = 'guest',
66   $rabbit_password     = 'guest',
67   $rabbit_hosts        = 'localhost',
68   $rabbit_port         = '5672',
69   $rabbit_virtual_host = '/',
70   $weight_offset       = '1.0',
71   $weight_scale        = '1.0'
72 ) {
73
74   File['/etc/nova/nova.conf'] -> Nova_cells[$name]
75   Exec<| title == 'nova-db-sync' |> -> Nova_cells[$name]
76
77   nova_cells { $name:
78     ensure              => present,
79     cell_type           => $cell_type,
80     cell_parent_name    => $cell_parent_name,
81     rabbit_username     => $rabbit_username,
82     rabbit_password     => $rabbit_password,
83     rabbit_hosts        => $rabbit_hosts,
84     rabbit_port         => $rabbit_port,
85     rabbit_virtual_host => $rabbit_virtual_host,
86     weight_offset       => $weight_offset,
87     weight_scale        => $weight_scale
88   }
89
90 }