salsa: more mail setup
[mirror/dsa-puppet.git] / 3rdparty / modules / postgresql / manifests / database_user.pp
1 # puppet-postgresql
2 # For all details and documentation:
3 # http://github.com/inkling/puppet-postgresql
4 #
5 # Copyright 2012- Inkling Systems, Inc.
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18
19 # Define: postgresql::database_user
20 #
21 # This type creates a postgres database user.
22 #
23 # Parameters:
24 #   [*user*]             - username to create.
25 #   [*password_hash*]    - user's password; this may be clear text, or an md5 hash as returned by the
26 #                           "postgresql_password" function in this module.
27 #
28 # Actions:
29 #
30 # Requires:
31 #
32 #
33 # Sample Usage:
34 #
35 #  postgresql::database_user { 'frank':
36 #    password_hash => postgresql_password('frank', 'password'),
37 #  }
38 #
39
40 define postgresql::database_user(
41   $password_hash    = false,
42   $createdb         = false,
43   $createrole       = false,
44   $db               = $postgresql::params::user,
45   $superuser        = false,
46   $replication      = false,
47   $connection_limit = '-1',
48   $user             = $title
49 ) {
50   postgresql::role { $user:
51     db               => $db,
52     password_hash    => $password_hash,
53     login            => true,
54     createdb         => $createdb,
55     superuser        => $superuser,
56     createrole       => $createrole,
57     replication      => $replication,
58     connection_limit => $connection_limit,
59   }
60 }