]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/neutron/manifests/db/mysql.pp
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / neutron / manifests / db / mysql.pp
1 # The neutron::db::mysql class creates a MySQL database for neutron.
2 # It must be used on the MySQL server
3 #
4 # == Parameters
5 #
6 #  [*password*]
7 #    password to connect to the database. Mandatory.
8 #
9 #  [*dbname*]
10 #    name of the database. Optional. Defaults to neutron.
11 #
12 #  [*user*]
13 #    user to connect to the database. Optional. Defaults to neutron.
14 #
15 #  [*host*]
16 #    the default source host user is allowed to connect from.
17 #    Optional. Defaults to 'localhost'
18 #
19 #  [*allowed_hosts*]
20 #    other hosts the user is allowd to connect from.
21 #    Optional. Defaults to undef.
22 #
23 #  [*charset*]
24 #    the database charset. Optional. Defaults to 'utf8'
25 #
26 #  [*collate*]
27 #    the database collation. Optional. Defaults to 'utf8_general_ci'
28 #
29 #  [*mysql_module*]
30 #   (optional) Deprecated. Does nothing.
31 #
32 class neutron::db::mysql (
33   $password,
34   $dbname        = 'neutron',
35   $user          = 'neutron',
36   $host          = '127.0.0.1',
37   $allowed_hosts = undef,
38   $charset       = 'utf8',
39   $collate       = 'utf8_general_ci',
40   $cluster_id    = 'localzone',
41   $mysql_module  = undef,
42 ) {
43
44   if $mysql_module {
45     warning('The mysql_module parameter is deprecated. The latest 2.x mysql module will be used.')
46   }
47
48   validate_string($password)
49
50
51   ::openstacklib::db::mysql { 'neutron':
52     user          => $user,
53     password_hash => mysql_password($password),
54     dbname        => $dbname,
55     host          => $host,
56     charset       => $charset,
57     collate       => $collate,
58     allowed_hosts => $allowed_hosts,
59   }
60   ::Openstacklib::Db::Mysql['neutron'] ~> Service <| title == 'neutron-server' |>
61 }