puppet-tuskar/manifests/db/postgresql.pp
Sebastien Badia fda22053b3 Migrate postgresql backend to use openstacklib::db::postgresql
Let migrate to the new openstacklib::db::postgresql helper for
postgresql backend. This commit also unpin postgresql fixture
(openstacklib support now the latest version of postgre module).

Change-Id: Ibf9bf074f1fb1712c0c5d70faa7d29a3b72bce29
Implements: blueprint commmon-openstack-database-resource
2015-03-21 14:39:18 +01:00

48 lines
1.1 KiB
Puppet

# == Class: tuskar::db::postgresql
#
# Class that configures postgresql for tuskar
# Requires the Puppetlabs postgresql module.
#
# === Parameters:
#
# [*password*]
# (Required) Password to connect to the database.
#
# [*dbname*]
# (Optional) Name of the database.
# Defaults to 'tuskar'.
#
# [*user*]
# (Optional) User to connect to the database.
# Defaults to 'tuskar'.
#
# [*encoding*]
# (Optional) The charset to use for the database.
# Default to undef.
#
# [*privileges*]
# (Optional) Privileges given to the database user.
# Default to 'ALL'
#
class tuskar::db::postgresql(
$password,
$dbname = 'tuskar',
$user = 'tuskar',
$encoding = undef,
$privileges = 'ALL',
) {
Class['tuskar::db::postgresql'] -> Service<| title == 'tuskar' |>
::openstacklib::db::postgresql { 'tuskar':
password_hash => postgresql_password($user, $password),
dbname => $dbname,
user => $user,
encoding => $encoding,
privileges => $privileges,
}
::Openstacklib::Db::Postgresql['tuskar'] ~> Exec<| title == 'tuskar-dbsync' |>
}