Support overriding resource type used in oslo::db class

This patch allows specyfing resource type used to apply configurations
in oslo::db class, so that we can use this class to set up parameters
for multiple databases.

Change-Id: I62c7d60c04b9ef0a3c74c7355c8e7a199ffc5cd5
This commit is contained in:
Takashi Kajinami 2020-08-31 20:32:40 +09:00
parent 893205bd3c
commit 130282bc98
1 changed files with 6 additions and 1 deletions

View File

@ -7,6 +7,10 @@
#
# === Parameters:
#
# [*config*]
# (Optional) The resource type used to apply configuration parameters.
# Defaults to $name
#
# [*config_group*]
# (Optional) The configuration group to set the database configuration in.
# Some OpenStack services might implement the oslo database options in another
@ -118,6 +122,7 @@
# Defaults to undef
#
define oslo::db(
$config = $name,
$config_group = 'database',
$sqlite_synchronous = $::os_service_default,
$backend = $::os_service_default,
@ -220,6 +225,6 @@ define oslo::db(
"${config_group}/mysql_enable_ndb" => { value => $mysql_enable_ndb },
}
create_resources($name, $database_options)
create_resources($config, $database_options)
}