]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/keystone/manifests/db/mysql.pp
3e046f4a29702e9fd9fc4c650fea25756c01fec6
[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] Password that will be used for the keystone db user.
9 #   Optional. Defaults to: 'keystone_default_password'
10 #
11 # [dbname] Name of keystone database. Optional. Defaults to keystone.
12 #
13 # [user] Name of keystone user. Optional. Defaults to keystone.
14 #
15 # [host] Host where user should be allowed all priveleges for database.
16 # Optional. Defaults to 127.0.0.1.
17 #
18 # [allowed_hosts] Hosts allowed to use the database
19 #
20 # [*mysql_module*] Deprecated. Does nothing.
21 #
22 # == Dependencies
23 #   Class['mysql::server']
24 #
25 # == Examples
26 # == Authors
27 #
28 #   Dan Bode dan@puppetlabs.com
29 #
30 # == Copyright
31 #
32 # Copyright 2012 Puppetlabs Inc, unless otherwise noted.
33 #
34 class keystone::db::mysql(
35   $password,
36   $dbname        = 'keystone',
37   $user          = 'keystone',
38   $host          = '127.0.0.1',
39   $charset       = 'utf8',
40   $collate       = 'utf8_unicode_ci',
41   $mysql_module  = undef,
42   $allowed_hosts = undef
43 ) {
44
45   if $mysql_module {
46     warning('The mysql_module parameter is deprecated. The latest 2.x mysql module will be used.')
47   }
48
49   validate_string($password)
50
51   ::openstacklib::db::mysql { 'keystone':
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
61   ::Openstacklib::Db::Mysql['keystone'] ~> Exec<| title == 'keystone-manage db_sync' |>
62 }