Puppet Class: nova::db::postgresql

Defined in:
manifests/db/postgresql.pp

Overview

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

Parameters:

  • password (String[1])
  • dbname (Any) (defaults to: 'nova')
  • user (Any) (defaults to: 'nova')
  • encoding (Any) (defaults to: undef)
  • privileges (Any) (defaults to: 'ALL')
  • setup_cell0 (Boolean) (defaults to: true)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'manifests/db/postgresql.pp', line 32

class nova::db::postgresql(
  String[1] $password,
  $dbname              = 'nova',
  $user                = 'nova',
  $encoding            = undef,
  $privileges          = 'ALL',
  Boolean $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']
}