2015-07-21 12:33:26 -07:00
|
|
|
# The zaqar::db::mysql class implements mysql backend for zaqar
|
|
|
|
#
|
|
|
|
# This class can be used to create tables, users and grant
|
2016-01-04 14:58:43 +05:30
|
|
|
# privileges for a mysql zaqar database.
|
2015-07-21 12:33:26 -07:00
|
|
|
#
|
2018-12-13 17:10:02 +08:00
|
|
|
# == Parameters
|
2015-07-21 12:33:26 -07:00
|
|
|
#
|
|
|
|
# [*password*]
|
2018-06-15 15:07:38 +08:00
|
|
|
# (Required) Password to connect to the database.
|
2015-07-21 12:33:26 -07:00
|
|
|
#
|
|
|
|
# [*dbname*]
|
|
|
|
# (Optional) Name of the database.
|
|
|
|
# Defaults to 'zaqar'.
|
|
|
|
#
|
|
|
|
# [*user*]
|
|
|
|
# (Optional) User to connect to the database.
|
|
|
|
# Defaults to 'zaqar'.
|
|
|
|
#
|
|
|
|
# [*host*]
|
|
|
|
# (Optional) The default source host user is allowed to connect from.
|
|
|
|
# Defaults to '127.0.0.1'
|
|
|
|
#
|
|
|
|
# [*allowed_hosts*]
|
|
|
|
# (Optional) Other hosts the user is allowed to connect from.
|
|
|
|
# Defaults to 'undef'.
|
|
|
|
#
|
|
|
|
# [*charset*]
|
|
|
|
# (Optional) The database charset.
|
|
|
|
# Defaults to 'utf8'
|
|
|
|
#
|
|
|
|
# [*collate*]
|
|
|
|
# (Optional) The database collate.
|
|
|
|
# Only used with mysql modules >= 2.2.
|
|
|
|
# Defaults to 'utf8_general_ci'
|
|
|
|
#
|
|
|
|
class zaqar::db::mysql(
|
|
|
|
$password,
|
|
|
|
$dbname = 'zaqar',
|
|
|
|
$user = 'zaqar',
|
|
|
|
$host = '127.0.0.1',
|
|
|
|
$charset = 'utf8',
|
|
|
|
$collate = 'utf8_general_ci',
|
|
|
|
$allowed_hosts = undef
|
|
|
|
) {
|
|
|
|
|
2019-12-08 23:26:05 +01:00
|
|
|
include zaqar::deps
|
2016-12-07 16:46:57 +08:00
|
|
|
|
2019-02-23 23:17:56 +01:00
|
|
|
validate_legacy(String, 'validate_string', $password)
|
2015-07-21 12:33:26 -07:00
|
|
|
|
|
|
|
::openstacklib::db::mysql { 'zaqar':
|
|
|
|
user => $user,
|
2020-05-19 20:40:06 +09:00
|
|
|
password => $password,
|
2015-07-21 12:33:26 -07:00
|
|
|
dbname => $dbname,
|
|
|
|
host => $host,
|
|
|
|
charset => $charset,
|
|
|
|
collate => $collate,
|
|
|
|
allowed_hosts => $allowed_hosts,
|
|
|
|
}
|
|
|
|
|
2016-12-07 16:46:57 +08:00
|
|
|
Anchor['zaqar::db::begin']
|
|
|
|
~> Class['zaqar::db::mysql']
|
|
|
|
~> Anchor['zaqar::db::end']
|
|
|
|
|
2015-07-21 12:33:26 -07:00
|
|
|
}
|