]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/keystone/manifests/db/postgresql.pp
try with modules from master
[dsa-puppet.git] / 3rdparty / modules / keystone / manifests / db / postgresql.pp
1 # == Class: keystone::db::postgresql
2 #
3 # Class that configures postgresql for keystone
4 # Requires the Puppetlabs postgresql module.
5 #
6 # == Authors
7 #
8 #   Stackforge Contributors puppet-openstack@puppetlabs.com
9 #   Etienne Pelletier epelletier@morphlabs.com
10 #
11 # == Copyright
12 #
13 # Copyright 2013-2014 Stackforge Contributors
14 # Copyright 2012 Etienne Pelletier, unless otherwise noted.
15 #
16 # === Parameters
17 #
18 # [*password*]
19 #   (Required) Password to connect to the database.
20 #
21 # [*dbname*]
22 #   (Optional) Name of the database.
23 #   Defaults to 'keystone'.
24 #
25 # [*user*]
26 #   (Optional) User to connect to the database.
27 #   Defaults to 'keystone'.
28 #
29 #  [*encoding*]
30 #    (Optional) The charset to use for the database.
31 #    Default to undef.
32 #
33 #  [*privileges*]
34 #    (Optional) Privileges given to the database user.
35 #    Default to 'ALL'
36 #
37 class keystone::db::postgresql(
38   $password,
39   $dbname     = 'keystone',
40   $user       = 'keystone',
41   $encoding   = undef,
42   $privileges = 'ALL',
43 ) {
44
45   Class['keystone::db::postgresql'] -> Service<| title == 'keystone' |>
46
47   ::openstacklib::db::postgresql { 'keystone':
48     password_hash => postgresql_password($user, $password),
49     dbname        => $dbname,
50     user          => $user,
51     encoding      => $encoding,
52     privileges    => $privileges,
53   }
54
55   ::Openstacklib::Db::Postgresql['keystone'] ~> Exec<| title == 'keystone-manage db_sync' |>
56
57 }