puppet-ironic/manifests/inspector/db/postgresql.pp
Takashi Kajinami 33057eb12d Remove password hash generation in each puppet modules
... 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: I2ca8100d1c4d0a8053e403c5ba6d3c2939b63af6
2020-05-19 20:57:01 +09:00

48 lines
1.1 KiB
Puppet

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