|
12 | 12 |
|
13 | 13 | # Needed for testing primarily, support for multiple files is not really |
14 | 14 | # working. |
15 | | - $target = $postgresql::server::pg_hba_conf_path |
| 15 | + $target = $postgresql::server::pg_hba_conf_path, |
| 16 | + $postgresql_version = $postgresql::server::_version |
16 | 17 | ) { |
17 | 18 |
|
18 | | - if $postgresql::server::manage_pg_hba_conf == false { |
| 19 | + #Allow users to manage pg_hba.conf even if they are not managing the whole PostgreSQL instance |
| 20 | + if !defined( 'postgresql::server' ) { |
| 21 | + $manage_pg_hba_conf = true |
| 22 | + } |
| 23 | + else { |
| 24 | + $manage_pg_hba_conf = $postgresql::server::manage_pg_hba_conf |
| 25 | + } |
| 26 | + |
| 27 | + if $manage_pg_hba_conf == false { |
19 | 28 | fail('postgresql::server::manage_pg_hba_conf has been disabled, so this resource is now unused and redundant, either enable that option or remove this resource from your manifests') |
20 | 29 | } else { |
21 | 30 | validate_re($type, '^(local|host|hostssl|hostnossl)$', |
|
25 | 34 | fail('You must specify an address property when type is host based') |
26 | 35 | } |
27 | 36 |
|
28 | | - $allowed_auth_methods = $postgresql::server::_version ? { |
| 37 | + $allowed_auth_methods = $postgresql_version ? { |
29 | 38 | '9.4' => ['trust', 'reject', 'md5', 'password', 'gss', 'sspi', 'ident', 'peer', 'ldap', 'radius', 'cert', 'pam'], |
30 | 39 | '9.3' => ['trust', 'reject', 'md5', 'password', 'gss', 'sspi', 'krb5', 'ident', 'peer', 'ldap', 'radius', 'cert', 'pam'], |
31 | 40 | '9.2' => ['trust', 'reject', 'md5', 'password', 'gss', 'sspi', 'krb5', 'ident', 'peer', 'ldap', 'radius', 'cert', 'pam'], |
|
0 commit comments