2014-07-11 10:47:18 -07:00
|
|
|
# The keystone::db::mysql class implements mysql backend for keystone
|
2012-03-29 14:39:59 -07:00
|
|
|
#
|
2012-04-06 15:48:05 -07:00
|
|
|
# This class can be used to create tables, users and grant
|
|
|
|
# privelege for a mysql keystone database.
|
|
|
|
#
|
2012-10-31 12:33:09 -07:00
|
|
|
# == parameters
|
2012-04-06 15:48:05 -07:00
|
|
|
#
|
|
|
|
# [password] Password that will be used for the keystone db user.
|
|
|
|
# Optional. Defaults to: 'keystone_default_password'
|
|
|
|
#
|
|
|
|
# [dbname] Name of keystone database. Optional. Defaults to keystone.
|
|
|
|
#
|
2013-09-10 22:54:49 -07:00
|
|
|
# [user] Name of keystone user. Optional. Defaults to keystone.
|
2012-04-06 15:48:05 -07:00
|
|
|
#
|
|
|
|
# [host] Host where user should be allowed all priveleges for database.
|
|
|
|
# Optional. Defaults to 127.0.0.1.
|
|
|
|
#
|
2012-04-17 17:16:48 +02:00
|
|
|
# [allowed_hosts] Hosts allowed to use the database
|
2012-04-06 15:48:05 -07:00
|
|
|
#
|
2014-07-11 10:47:18 -07:00
|
|
|
# [*mysql_module*] Deprecated. Does nothing.
|
2014-02-26 22:31:47 +11:00
|
|
|
#
|
2012-04-06 15:48:05 -07:00
|
|
|
# == Dependencies
|
|
|
|
# Class['mysql::server']
|
|
|
|
#
|
|
|
|
# == Examples
|
|
|
|
# == Authors
|
|
|
|
#
|
|
|
|
# Dan Bode dan@puppetlabs.com
|
|
|
|
#
|
|
|
|
# == Copyright
|
|
|
|
#
|
|
|
|
# Copyright 2012 Puppetlabs Inc, unless otherwise noted.
|
|
|
|
#
|
2012-04-21 21:52:11 -07:00
|
|
|
class keystone::db::mysql(
|
2012-10-14 11:51:45 -07:00
|
|
|
$password,
|
2012-03-29 14:39:59 -07:00
|
|
|
$dbname = 'keystone',
|
2013-09-10 22:54:49 -07:00
|
|
|
$user = 'keystone',
|
2012-03-29 14:39:59 -07:00
|
|
|
$host = '127.0.0.1',
|
2014-03-31 22:45:16 -07:00
|
|
|
$charset = 'utf8',
|
|
|
|
$collate = 'utf8_unicode_ci',
|
2014-07-11 10:47:18 -07:00
|
|
|
$mysql_module = undef,
|
2012-03-29 14:39:59 -07:00
|
|
|
$allowed_hosts = undef
|
|
|
|
) {
|
|
|
|
|
2014-07-11 10:47:18 -07:00
|
|
|
if $mysql_module {
|
|
|
|
warning('The mysql_module parameter is deprecated. The latest 2.x mysql module will be used.')
|
2012-03-29 14:39:59 -07:00
|
|
|
}
|
|
|
|
|
2014-07-11 10:47:18 -07:00
|
|
|
validate_string($password)
|
2013-05-08 14:13:17 -07:00
|
|
|
|
2014-07-11 10:47:18 -07:00
|
|
|
::openstacklib::db::mysql { 'keystone':
|
|
|
|
user => $user,
|
|
|
|
password_hash => mysql_password($password),
|
|
|
|
dbname => $dbname,
|
|
|
|
host => $host,
|
|
|
|
charset => $charset,
|
|
|
|
collate => $collate,
|
|
|
|
allowed_hosts => $allowed_hosts,
|
2012-04-05 23:53:18 -07:00
|
|
|
}
|
|
|
|
|
2014-07-11 10:47:18 -07:00
|
|
|
::Openstacklib::Db::Mysql['keystone'] ~> Exec<| title == 'keystone-manage db_sync' |>
|
2012-03-29 14:39:59 -07:00
|
|
|
}
|