aboutsummaryrefslogtreecommitdiffstats
path: root/modules/postgresql/manifests/hba_entry.pp
blob: 595fd33cf6981ec8c658104e12758c80b8a8159f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# == Define: postgresql::hba_entry
#
# Set a new entry to pg_hba.conf file
#
# === Parameters
#
# See pgsql doc for more details about pg_hba.conf parameters :
# http://www.postgresql.org/docs/9.1/static/auth-pg-hba-conf.html
#
# [*namevar*]
#   namevar is not used.
#
# [*type*]
#   can be local, host, hostssl, hostnossl
#
# [*database*]
#   database name
#
# [*user*]
#   user name
#
# [*address*]
#   host name or IP address range
#
# [*method*]
#   authentication method to use
#
define postgresql::hba_entry(
  $type,
  $database,
  $user,
  $address,
  $method
) {
  include postgresql::var
  Postgresql::Pg_hba <| title == $postgresql::var::hba_file |> {
    conf_lines +> "${type} ${database} ${user} ${address} ${method}",
  }
}
# vim: sw=2