Daniel Pawlik c5ddc31f46 Implement watcher-db-manage commands
Added DB commands: upgrade and create_schema.
Removed sync command.


Change-Id: I1c4e2c36ba675cfbbbde3b038067f73c98c150ff
2016-07-11 19:24:28 +00:00

57 lines
1.3 KiB
Puppet

# == 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,
}
::Openstacklib::Db::Postgresql['watcher'] ~> Exec<| title == 'watcher-db-manage-create_schema' |>
::Openstacklib::Db::Postgresql['watcher'] ~> Exec<| title == 'watcher-db-manage-upgrade' |>
}