2016-05-31 11:37:25 +00:00
|
|
|
# == Class: watcher::db::postgresql
|
|
|
|
#
|
|
|
|
# Class that configures postgresql for watcher
|
|
|
|
# Requires the Puppetlabs postgresql module.
|
|
|
|
#
|
|
|
|
# === Parameters
|
|
|
|
#
|
|
|
|
# [*password*]
|
|
|
|
# (Required) Password to connect to the database.
|
|
|
|
#
|
|
|
|
# [*dbname*]
|
|
|
|
# (Optional) Name of the database.
|
|
|
|
# Defaults to 'watcher'.
|
|
|
|
#
|
|
|
|
# [*user*]
|
|
|
|
# (Optional) User to connect to the database.
|
|
|
|
# Defaults to 'watcher'.
|
|
|
|
#
|
|
|
|
# [*encoding*]
|
|
|
|
# (Optional) The charset to use for the database.
|
|
|
|
# Default to undef.
|
|
|
|
#
|
|
|
|
# [*privileges*]
|
|
|
|
# (Optional) Privileges given to the database user.
|
|
|
|
# Default to 'ALL'
|
|
|
|
#
|
|
|
|
# == Dependencies
|
|
|
|
#
|
|
|
|
# == Examples
|
|
|
|
#
|
|
|
|
# == Authors
|
|
|
|
#
|
|
|
|
# == Copyright
|
|
|
|
#
|
|
|
|
class watcher::db::postgresql(
|
|
|
|
$password,
|
|
|
|
$dbname = 'watcher',
|
|
|
|
$user = 'watcher',
|
|
|
|
$encoding = undef,
|
|
|
|
$privileges = 'ALL',
|
|
|
|
) {
|
|
|
|
|
|
|
|
Class['watcher::db::postgresql'] -> Service<| title == 'watcher' |>
|
|
|
|
|
|
|
|
::openstacklib::db::postgresql { 'watcher':
|
|
|
|
password_hash => postgresql_password($user, $password),
|
|
|
|
dbname => $dbname,
|
|
|
|
user => $user,
|
|
|
|
encoding => $encoding,
|
|
|
|
privileges => $privileges,
|
|
|
|
}
|
|
|
|
|
2016-07-03 17:38:21 +00:00
|
|
|
::Openstacklib::Db::Postgresql['watcher'] ~> Exec<| title == 'watcher-db-manage-create_schema' |>
|
|
|
|
::Openstacklib::Db::Postgresql['watcher'] ~> Exec<| title == 'watcher-db-manage-upgrade' |>
|
2016-05-31 11:37:25 +00:00
|
|
|
|
|
|
|
}
|