]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/nova/manifests/db/mysql.pp
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / nova / manifests / db / mysql.pp
1 # == Class: nova::db::mysql
2 #
3 # Class that configures mysql for nova
4 #
5 # === Parameters:
6 #
7 # [*password*]
8 #   Password to use for the nova user
9 #
10 # [*dbname*]
11 #   (optional) The name of the database
12 #   Defaults to 'nova'
13 #
14 # [*user*]
15 #   (optional) The mysql user to create
16 #   Defaults to 'nova'
17 #
18 # [*host*]
19 #   (optional) The IP address of the mysql server
20 #   Defaults to '127.0.0.1'
21 #
22 # [*charset*]
23 #   (optional) The charset to use for the nova database
24 #   Defaults to 'utf8'
25 #
26 # [*collate*]
27 #   (optional) The collate to use for the nova database
28 #   Defaults to 'utf8_general_ci'
29 #
30 # [*allowed_hosts*]
31 #   (optional) Additional hosts that are allowed to access this DB
32 #   Defaults to undef
33 #
34 # [*cluster_id*]
35 #   (optional) Deprecated. Does nothing
36 #   Defaults to 'localzone'
37 #
38 # [*mysql_module*]
39 #   (optional) Deprecated. Does nothing.
40 #
41 class nova::db::mysql(
42   $password,
43   $dbname        = 'nova',
44   $user          = 'nova',
45   $host          = '127.0.0.1',
46   $charset       = 'utf8',
47   $collate       = 'utf8_general_ci',
48   $allowed_hosts = undef,
49   $mysql_module  = undef,
50   $cluster_id    = undef
51 ) {
52
53   if $cluster_id {
54     warning('The cluster_id parameter is deprecated and has no effect.')
55   }
56
57   if $mysql_module {
58     warning('The mysql_module parameter is deprecated. The latest 2.x mysql module will be used.')
59   }
60
61   ::openstacklib::db::mysql { 'nova':
62     user          => $user,
63     password_hash => mysql_password($password),
64     dbname        => $dbname,
65     host          => $host,
66     charset       => $charset,
67     collate       => $collate,
68     allowed_hosts => $allowed_hosts,
69   }
70
71   ::Openstacklib::Db::Mysql['nova'] ~> Exec<| title == 'nova-db-sync' |>
72 }