Skip to content

Commit 0f03dfe

Browse files
add pg_hba_auth_password_encryption parameter
1 parent efd0cab commit 0f03dfe

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

manifests/server.pp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@
9696
# @param manage_logdir Set to false if you have file{ $logdir: } already defined
9797
# @param manage_xlogdir Set to false if you have file{ $xlogdir: } already defined
9898
# @param password_encryption Specify the type of encryption set for the password.
99-
#
99+
# @param pg_hba_auth_password_encryption
100+
# Specify the type of encryption set for the password in pg_hba_conf,
101+
# this value is usefull if you want to start enforcing scram-sha-256, but give users transition time.
100102
# @param roles Specifies a hash from which to generate postgresql::server::role resources.
101103
# @param config_entries Specifies a hash from which to generate postgresql::server::config_entry resources.
102104
# @param pg_hba_rules Specifies a hash from which to generate postgresql::server::pg_hba_rule resources.
@@ -179,6 +181,7 @@
179181
Boolean $manage_logdir = $postgresql::params::manage_logdir,
180182
Boolean $manage_xlogdir = $postgresql::params::manage_xlogdir,
181183
Postgresql::Pg_password_encryption $password_encryption = $postgresql::params::password_encryption,
184+
Postgresql::Pg_password_encryption $pg_hba_auth_password_encryption = undef,
182185
Optional[String] $extra_systemd_config = $postgresql::params::extra_systemd_config,
183186

184187
Hash[String, Hash] $roles = {},

manifests/server/instance/config.pp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
# @param log_line_prefix PostgreSQL log line prefix
4343
# @param timezone Set timezone for the PostgreSQL instance
4444
# @param password_encryption Specify the type of encryption set for the password.
45+
# @param pg_hba_auth_password_encryption
46+
# Specify the type of encryption set for the password in pg_hba_conf,
47+
# this value is usefull if you want to start enforcing scram-sha-256, but give users transition time.
4548
# @param extra_systemd_config
4649
# Adds extra config to systemd config file, can for instance be used to add extra openfiles. This can be a multi line string
4750
define postgresql::server::instance::config (
@@ -71,8 +74,15 @@
7174
Optional[String[1]] $log_line_prefix = $postgresql::server::log_line_prefix,
7275
Optional[String[1]] $timezone = $postgresql::server::timezone,
7376
Postgresql::Pg_password_encryption $password_encryption = $postgresql::server::password_encryption,
77+
Postgresql::Pg_password_encryption $pg_hba_auth_password_encryption = $postgresql::server::pg_hba_auth_password_encryption,
7478
Optional[String] $extra_systemd_config = $postgresql::server::extra_systemd_config,
7579
) {
80+
if $pg_hba_auth_password_encryption {
81+
$override_pg_hba_auth_password_encryption = $pg_hba_auth_password_encryption
82+
} else {
83+
$override_pg_hba_auth_password_encryption = $password_encryption
84+
}
85+
7686
if ($manage_pg_hba_conf == true) {
7787
# Prepare the main pg_hba file
7888
concat { $pg_hba_conf_path:

0 commit comments

Comments
 (0)