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
|
2016-01-04 14:51:22 +05:30
|
|
|
# privilege for a mysql keystone database.
|
2012-04-06 15:48:05 -07:00
|
|
|
#
|
2018-12-13 17:10:01 +08:00
|
|
|
# == Parameters
|
2012-04-06 15:48:05 -07:00
|
|
|
#
|
2015-03-15 16:23:09 +01:00
|
|
|
# [*password*]
|
2018-06-15 15:07:37 +08:00
|
|
|
# (Required) Password to connect to the database.
|
2012-04-06 15:48:05 -07:00
|
|
|
#
|
2015-03-15 16:23:09 +01:00
|
|
|
# [*dbname*]
|
|
|
|
# (Optional) Name of the database.
|
|
|
|
# Defaults to 'keystone'.
|
2012-04-06 15:48:05 -07:00
|
|
|
#
|
2015-03-15 16:23:09 +01:00
|
|
|
# [*user*]
|
|
|
|
# (Optional) User to connect to the database.
|
|
|
|
# Defaults to 'keystone'.
|
2012-04-06 15:48:05 -07:00
|
|
|
#
|
2015-03-15 16:23:09 +01:00
|
|
|
# [*host*]
|
|
|
|
# (Optional) The default source host user is allowed to connect from.
|
|
|
|
# Defaults to '127.0.0.1'
|
2012-04-06 15:48:05 -07:00
|
|
|
#
|
2015-03-15 16:23:09 +01:00
|
|
|
# [*allowed_hosts*]
|
|
|
|
# (Optional) Other hosts the user is allowed to connect from.
|
|
|
|
# Defaults to 'undef'.
|
2012-04-06 15:48:05 -07:00
|
|
|
#
|
2015-03-15 16:23:09 +01:00
|
|
|
# [*charset*]
|
|
|
|
# (Optional) The database charset.
|
|
|
|
# Defaults to 'utf8'
|
|
|
|
#
|
|
|
|
# [*collate*]
|
|
|
|
# (Optional) The database collate.
|
|
|
|
# Only used with mysql modules >= 2.2.
|
2015-04-21 13:10:58 -04:00
|
|
|
# Defaults to 'utf8_general_ci'
|
2015-03-15 16:23:09 +01:00
|
|
|
#
|
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',
|
2015-04-21 13:10:58 -04:00
|
|
|
$collate = 'utf8_general_ci',
|
2012-03-29 14:39:59 -07:00
|
|
|
$allowed_hosts = undef
|
|
|
|
) {
|
|
|
|
|
2019-12-08 23:09:22 +01:00
|
|
|
include keystone::deps
|
2016-02-23 18:31:15 -07:00
|
|
|
|
2019-02-23 12:32:35 +01:00
|
|
|
validate_legacy(String, '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,
|
2020-05-19 20:09:38 +09:00
|
|
|
password => $password,
|
2014-07-11 10:47:18 -07:00
|
|
|
dbname => $dbname,
|
|
|
|
host => $host,
|
|
|
|
charset => $charset,
|
|
|
|
collate => $collate,
|
|
|
|
allowed_hosts => $allowed_hosts,
|
2012-04-05 23:53:18 -07:00
|
|
|
}
|
|
|
|
|
2016-02-23 18:31:15 -07:00
|
|
|
Anchor['keystone::db::begin']
|
|
|
|
~> Class['keystone::db::mysql']
|
|
|
|
~> Anchor['keystone::db::end']
|
2012-03-29 14:39:59 -07:00
|
|
|
}
|