3
0
Files
confdroid_postgresql/manifests/server/pghba/pg_hba_rule.pp
2025-10-01 13:24:51 +02:00

46 lines
2.1 KiB
Puppet

## postgresql_cd::server::pghba::pg_hba_rule
# Module name: postgresql_cd
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary define manages rule entries for pg_hba configuration file
# @see https://www.postgresql.org/docs/9.6/static/auth-pg-hba-conf.html
# @param [string] pl_auth_type Specify the authentication type, can be
# 'local', 'host', 'hostssl' or 'hostnossl'.
# @param [string] pl_auth_database Specify the database for the connection
# @param [string] pl_auth_user Specify the user for the connection
# @param [string] pl_auth_address SPecify IP address or FQDN for the
# connection, i.e. where to connect FROM.
# @param [string] pl_auth_method Specify the auth method, can be 'trust',
# 'reject', 'md5' , 'password', 'gss', 'sspi', 'ident', 'peer', 'ldap',
# 'radius', 'cert', 'pam','bsd'
# @param [string] pl_auth_option After the auth-method field, there can be
# field(s) of the form name=value that specify options for the authentication
# method.
# @param [string] pl_auth_order Specify the order in which the entry should
# appear on the list. Lower orders are higher on the list.
# @param [string] pl_auth_description Specify a description for the entry.
##############################################################################
define postgresql_cd::server::pghba::pg_hba_rule (
Optional[String] $pl_auth_type = undef,
Optional[String] $pl_auth_database = undef,
Optional[String] $pl_auth_user = undef,
Optional[String] $pl_auth_address = undef,
Optional[String] $pl_auth_method = undef,
Optional[String] $pl_auth_option = undef,
Optional[String] $pl_auth_order = undef,
Optional[String] $pl_auth_description = undef,
) {
$pl_pg_hba_conf = $postgresql_cd::params::pl_pg_hba_conf
$pl_pg_hba_rule_conf = $postgresql_cd::params::pl_pg_hba_rule_conf
$pl_data_dir = $postgresql_cd::params::pl_data_dir
# create rule fragment
concat::fragment { "pl_rule_${name}":
target => $pl_pg_hba_conf,
content => template($pl_pg_hba_rule_conf),
order => $pl_auth_order,
}
}