dca9fe942b
Previously the anchors and dependencies that allow external hooks were all in the main ::heat class. However, if you wanted to include just ::heat::db::mysql, then it would fail, since it assumed the main heat class was included. This moves all of those resources and relationships into a new class, ::heat::deps. All of the classes will now include this class so that the anchors and deps are always evaluated even if only a portion of the classes are used, and even if ::heat isn't pulled in. Change-Id: I4297df160a7afae2b66c1ac76e37de313fa4fb09 Closes-Bug: #1507934
49 lines
1.0 KiB
Puppet
49 lines
1.0 KiB
Puppet
# == Class: heat::db::postgresql
|
|
#
|
|
# Class that configures postgresql for heat
|
|
# Requires the Puppetlabs postgresql module.
|
|
#
|
|
# === Parameters
|
|
#
|
|
# [*password*]
|
|
# (Required) Password to connect to the database.
|
|
#
|
|
# [*dbname*]
|
|
# (Optional) Name of the database.
|
|
# Defaults to 'heat'.
|
|
#
|
|
# [*user*]
|
|
# (Optional) User to connect to the database.
|
|
# Defaults to 'heat'.
|
|
#
|
|
# [*encoding*]
|
|
# (Optional) The charset to use for the database.
|
|
# Default to undef.
|
|
#
|
|
# [*privileges*]
|
|
# (Optional) Privileges given to the database user.
|
|
# Default to 'ALL'
|
|
#
|
|
class heat::db::postgresql(
|
|
$password,
|
|
$dbname = 'heat',
|
|
$user = 'heat',
|
|
$encoding = undef,
|
|
$privileges = 'ALL',
|
|
) {
|
|
|
|
include ::heat::deps
|
|
|
|
::openstacklib::db::postgresql { 'heat':
|
|
password_hash => postgresql_password($user, $password),
|
|
dbname => $dbname,
|
|
user => $user,
|
|
encoding => $encoding,
|
|
privileges => $privileges,
|
|
}
|
|
|
|
Anchor['heat::db::begin']
|
|
~> Class['heat::db::postgresql']
|
|
~> Anchor['heat::db::end']
|
|
}
|