2016-05-31 11:37:25 +00:00
|
|
|
# The watcher::db::mysql class implements mysql backend for watcher
|
|
|
|
#
|
|
|
|
# This class can be used to create tables, users and grant
|
|
|
|
# privilege for a mysql watcher database.
|
|
|
|
#
|
2018-12-13 17:10:02 +08:00
|
|
|
# == Parameters
|
2016-05-31 11:37:25 +00:00
|
|
|
#
|
|
|
|
# [*password*]
|
2018-06-15 15:07:38 +08:00
|
|
|
# (Required) Password to connect to the database.
|
2016-05-31 11:37:25 +00:00
|
|
|
#
|
|
|
|
# [*dbname*]
|
|
|
|
# (Optional) Name of the database.
|
|
|
|
# Defaults to 'watcher'.
|
|
|
|
#
|
|
|
|
# [*user*]
|
|
|
|
# (Optional) User to connect to the database.
|
|
|
|
# Defaults to 'watcher'.
|
|
|
|
#
|
|
|
|
# [*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 watcher::db::mysql(
|
2023-06-20 22:30:11 +09:00
|
|
|
String[1] $password,
|
2016-05-31 11:37:25 +00:00
|
|
|
$dbname = 'watcher',
|
|
|
|
$user = 'watcher',
|
|
|
|
$host = '127.0.0.1',
|
|
|
|
$charset = 'utf8',
|
|
|
|
$collate = 'utf8_general_ci',
|
|
|
|
$allowed_hosts = undef
|
|
|
|
) {
|
|
|
|
|
2019-12-08 23:25:42 +01:00
|
|
|
include watcher::deps
|
2016-12-01 17:54:42 +08:00
|
|
|
|
2025-02-18 02:06:12 +09:00
|
|
|
openstacklib::db::mysql { 'watcher':
|
2016-05-31 11:37:25 +00:00
|
|
|
user => $user,
|
2020-05-20 08:35:22 +09:00
|
|
|
password => $password,
|
2016-05-31 11:37:25 +00:00
|
|
|
dbname => $dbname,
|
|
|
|
host => $host,
|
|
|
|
charset => $charset,
|
|
|
|
collate => $collate,
|
|
|
|
allowed_hosts => $allowed_hosts,
|
|
|
|
}
|
|
|
|
|
2016-12-01 17:54:42 +08:00
|
|
|
Anchor['watcher::db::begin']
|
|
|
|
~> Class['watcher::db::mysql']
|
|
|
|
~> Anchor['watcher::db::end']
|
2016-07-03 17:38:21 +00:00
|
|
|
|
2016-05-31 11:37:25 +00:00
|
|
|
}
|