puppet-nova/manifests/db/postgresql.pp
Takashi Kajinami c6b53de070 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: I0f7d05983a6d8bc6808f8595bc9d94c6aa4f7800
2020-05-18 23:53:54 +09:00

66 lines
1.5 KiB
Puppet

# == Class: nova::db::postgresql
#
# Class that configures postgresql for nova
# Requires the Puppetlabs postgresql module.
#
# === Parameters
#
# [*password*]
# (Required) Password to connect to the database.
#
# [*dbname*]
# (Optional) Name of the database.
# Defaults to 'nova'.
#
# [*user*]
# (Optional) User to connect to the database.
# Defaults to 'nova'.
#
# [*encoding*]
# (Optional) The charset to use for the database.
# Default to undef.
#
# [*privileges*]
# (Optional) Privileges given to the database user.
# Default to 'ALL'
#
# [*setup_cell0*]
# (Optional) Setup a cell0 for the cell_v2 functionality. This option will
# be set to true by default in Ocata when the cell v2 setup is mandatory.
# Defaults to true
#
class nova::db::postgresql(
$password,
$dbname = 'nova',
$user = 'nova',
$encoding = undef,
$privileges = 'ALL',
$setup_cell0 = true,
) {
include nova::deps
::openstacklib::db::postgresql { 'nova':
password => $password,
dbname => $dbname,
user => $user,
encoding => $encoding,
privileges => $privileges,
}
if $setup_cell0 {
# need for cell_v2
::openstacklib::db::postgresql { 'nova_cell0':
password => $password,
dbname => "${dbname}_cell0",
user => $user,
encoding => $encoding,
privileges => $privileges,
}
}
Anchor['nova::db::begin']
~> Class['nova::db::postgresql']
~> Anchor['nova::db::end']
}