... and migrate it to openstacklib so that all logics about database configuration are implemented in one common place. Depends-on: https://review.opendev.org/#/c/728595/ Change-Id: I900142c35e8fb20d3279f607cdd80ad53157531c
50 lines
1.0 KiB
Puppet
50 lines
1.0 KiB
Puppet
# == Class: ec2api::db::postgresql
|
|
#
|
|
# Class that configures postgresql for ec2api
|
|
# Requires the Puppetlabs postgresql module.
|
|
#
|
|
# === Parameters
|
|
#
|
|
# [*password*]
|
|
# (Required) Password to connect to the database.
|
|
#
|
|
# [*dbname*]
|
|
# (Optional) Name of the database.
|
|
# Defaults to 'ec2api'.
|
|
#
|
|
# [*user*]
|
|
# (Optional) User to connect to the database.
|
|
# Defaults to 'ec2api'.
|
|
#
|
|
# [*encoding*]
|
|
# (Optional) The charset to use for the database.
|
|
# Default to undef.
|
|
#
|
|
# [*privileges*]
|
|
# (Optional) Privileges given to the database user.
|
|
# Default to 'ALL'
|
|
#
|
|
class ec2api::db::postgresql (
|
|
$password,
|
|
$user = 'ec2api',
|
|
$dbname = 'ec2api',
|
|
$encoding = undef,
|
|
$privileges = 'ALL',
|
|
) {
|
|
|
|
include ec2api::deps
|
|
|
|
::openstacklib::db::postgresql { 'ec2api':
|
|
password => $password,
|
|
dbname => $dbname,
|
|
user => $user,
|
|
encoding => $encoding,
|
|
privileges => $privileges,
|
|
}
|
|
|
|
Anchor['ec2api::db::begin']
|
|
~> Class['ec2api::db::postgresql']
|
|
~> Anchor['ec2api::db::end']
|
|
|
|
}
|