2015-08-28 14:40:33 +03:00
|
|
|
# == Class: murano::db::postgresql
|
|
|
|
#
|
|
|
|
# The murano::db::postgresql creates a PostgreSQL database for murano.
|
|
|
|
# It must be used on the PostgreSQL server.
|
|
|
|
#
|
|
|
|
# === Parameters
|
|
|
|
#
|
|
|
|
# [*password*]
|
|
|
|
# (Required) Password to connect to the database.
|
|
|
|
#
|
|
|
|
# [*dbname*]
|
|
|
|
# (Optional) Name of the database.
|
|
|
|
# Defaults to 'murano'.
|
|
|
|
#
|
|
|
|
# [*user*]
|
|
|
|
# (Optional) User to connect to the database.
|
|
|
|
# Defaults to 'murano'.
|
|
|
|
#
|
|
|
|
# [*encoding*]
|
|
|
|
# (Optional) The charset to use for the database.
|
|
|
|
# Default to undef.
|
|
|
|
#
|
|
|
|
# [*privileges*]
|
|
|
|
# (Optional) Privileges given to the database user.
|
|
|
|
# Default to 'ALL'
|
|
|
|
#
|
|
|
|
class murano::db::postgresql(
|
|
|
|
$password,
|
|
|
|
$dbname = 'murano',
|
|
|
|
$user = 'murano',
|
|
|
|
$encoding = undef,
|
|
|
|
$privileges = 'ALL',
|
|
|
|
) {
|
|
|
|
|
2016-12-07 10:06:17 +08:00
|
|
|
include ::murano::deps
|
|
|
|
|
2019-02-23 23:23:09 +01:00
|
|
|
validate_legacy(String, 'validate_string', $password)
|
2015-08-28 14:40:33 +03:00
|
|
|
|
|
|
|
::openstacklib::db::postgresql { 'murano':
|
|
|
|
password_hash => postgresql_password($user, $password),
|
|
|
|
dbname => $dbname,
|
|
|
|
user => $user,
|
|
|
|
encoding => $encoding,
|
|
|
|
privileges => $privileges,
|
|
|
|
}
|
|
|
|
|
2016-12-07 10:06:17 +08:00
|
|
|
Anchor['murano::db::begin']
|
|
|
|
~> Class['murano::db::postgresql']
|
|
|
|
~> Anchor['murano::db::end']
|
2015-08-28 14:40:33 +03:00
|
|
|
|
|
|
|
}
|