]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/keystone/manifests/db/mysql.pp
try with modules from master
[dsa-puppet.git] / 3rdparty / modules / keystone / manifests / db / mysql.pp
1 # The keystone::db::mysql class implements mysql backend for keystone
2 #
3 # This class can be used to create tables, users and grant
4 # privelege for a mysql keystone database.
5 #
6 # == parameters
7 #
8 # [*password*]
9 #   (Mandatory) Password to connect to the database.
10 #   Defaults to 'false'.
11 #
12 # [*dbname*]
13 #   (Optional) Name of the database.
14 #   Defaults to 'keystone'.
15 #
16 # [*user*]
17 #   (Optional) User to connect to the database.
18 #   Defaults to 'keystone'.
19 #
20 # [*host*]
21 #   (Optional) The default source host user is allowed to connect from.
22 #   Defaults to '127.0.0.1'
23 #
24 # [*allowed_hosts*]
25 #   (Optional) Other hosts the user is allowed to connect from.
26 #   Defaults to 'undef'.
27 #
28 # [*charset*]
29 #   (Optional) The database charset.
30 #   Defaults to 'utf8'
31 #
32 # [*collate*]
33 #   (Optional) The database collate.
34 #   Only used with mysql modules >= 2.2.
35 #   Defaults to 'utf8_general_ci'
36 #
37 # === Deprecated Parameters
38 #
39 # [*mysql_module*]
40 #   (Optional) Does nothing.
41 #
42 # == Dependencies
43 #   Class['mysql::server']
44 #
45 # == Examples
46 # == Authors
47 #
48 #   Dan Bode dan@puppetlabs.com
49 #
50 # == Copyright
51 #
52 # Copyright 2012 Puppetlabs Inc, unless otherwise noted.
53 #
54 class keystone::db::mysql(
55   $password,
56   $dbname        = 'keystone',
57   $user          = 'keystone',
58   $host          = '127.0.0.1',
59   $charset       = 'utf8',
60   $collate       = 'utf8_general_ci',
61   $mysql_module  = undef,
62   $allowed_hosts = undef
63 ) {
64
65   if $mysql_module {
66     warning('The mysql_module parameter is deprecated. The latest 2.x mysql module will be used.')
67   }
68
69   validate_string($password)
70
71   ::openstacklib::db::mysql { 'keystone':
72     user          => $user,
73     password_hash => mysql_password($password),
74     dbname        => $dbname,
75     host          => $host,
76     charset       => $charset,
77     collate       => $collate,
78     allowed_hosts => $allowed_hosts,
79   }
80
81   ::Openstacklib::Db::Mysql['keystone'] ~> Exec<| title == 'keystone-manage db_sync' |>
82 }