From db0f568c9b134cc3a95b538022bfb1017f8b8567 Mon Sep 17 00:00:00 2001 From: Simon Hoenscheid Date: Wed, 23 Aug 2023 15:37:51 +0200 Subject: [PATCH] better parameter naming --- manifests/server.pp | 4 +-- manifests/server/initdb.pp | 36 +++++++++++----------- manifests/server/instance/initdb.pp | 46 ++++++++++++++--------------- 3 files changed, 43 insertions(+), 43 deletions(-) diff --git a/manifests/server.pp b/manifests/server.pp index 9239231379..93d684c773 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -113,7 +113,7 @@ # @param auth_host auth method used by default for host authorization # @param auth_local auth method used by default for local authorization # @param lc_messages locale used for logging and system messages -# @param username username of user running the postgres instance +# @param instance_username username of user running the postgres instance # class postgresql::server ( Optional[Variant[String[1], Sensitive[String[1]], Integer]] $postgres_password = undef, @@ -169,7 +169,7 @@ Optional[String[1]] $locale = $postgresql::params::locale, Optional[String[1]] $lc_messages = undef, Optional[Boolean] $data_checksums = $postgresql::params::data_checksums, - Optional[String[1]] $username = undef, + Optional[String[1]] $instance_username = $user, Optional[String[1]] $timezone = $postgresql::params::timezone, Boolean $manage_pg_hba_conf = $postgresql::params::manage_pg_hba_conf, diff --git a/manifests/server/initdb.pp b/manifests/server/initdb.pp index 605e9ea79e..90a2f2047f 100644 --- a/manifests/server/initdb.pp +++ b/manifests/server/initdb.pp @@ -1,23 +1,23 @@ # @api private class postgresql::server::initdb { postgresql::server::instance::initdb { 'main': - auth_host => $postgresql::server::auth_host, - auth_local => $postgresql::server::auth_local, - data_checksums => $postgresql::server::data_checksums, - datadir => $postgresql::server::datadir, - encoding => $postgresql::server::encoding, - group => $postgresql::server::group, - initdb_path => $postgresql::server::initdb_path, - lc_messages => $postgresql::server::lc_messages, - locale => $postgresql::server::locale, - logdir => $postgresql::server::logdir, - manage_datadir => $postgresql::server::manage_datadir, - manage_logdir => $postgresql::server::manage_logdir, - manage_xlogdir => $postgresql::server::manage_xlogdir, - module_workdir => $postgresql::server::module_workdir, - needs_initdb => $postgresql::server::needs_initdb, - user => $postgresql::server::user, - username => $postgresql::server::username, - xlogdir => $postgresql::server::xlogdir, + auth_host => $postgresql::server::auth_host, + auth_local => $postgresql::server::auth_local, + data_checksums => $postgresql::server::data_checksums, + datadir => $postgresql::server::datadir, + encoding => $postgresql::server::encoding, + group => $postgresql::server::group, + initdb_path => $postgresql::server::initdb_path, + lc_messages => $postgresql::server::lc_messages, + locale => $postgresql::server::locale, + logdir => $postgresql::server::logdir, + manage_datadir => $postgresql::server::manage_datadir, + manage_logdir => $postgresql::server::manage_logdir, + manage_xlogdir => $postgresql::server::manage_xlogdir, + module_workdir => $postgresql::server::module_workdir, + needs_initdb => $postgresql::server::needs_initdb, + user => $postgresql::server::user, + instance_username => $postgresql::server::instance_username, + xlogdir => $postgresql::server::xlogdir, } } diff --git a/manifests/server/instance/initdb.pp b/manifests/server/instance/initdb.pp index e912f2e505..4f5e38b6e3 100644 --- a/manifests/server/instance/initdb.pp +++ b/manifests/server/instance/initdb.pp @@ -28,29 +28,29 @@ # changing the port causes the server to come to a full stop before being able to make the change. # @param psql_path Specifies the path to the psql command. # @param user Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system. -# @param username username of user running the postgres instance +# @param instance_username username of user running the postgres instance # @param xlogdir PostgreSQL xlog/WAL directory define postgresql::server::instance::initdb ( - Optional[String[1]] $auth_host = $postgresql::server::auth_host, - Optional[String[1]] $auth_local = $postgresql::server::auth_local, - Optional[Boolean] $data_checksums = $postgresql::server::data_checksums, - String[1] $datadir = $postgresql::server::datadir, - Optional[String[1]] $encoding = $postgresql::server::encoding, - String[1] $group = $postgresql::server::group, - Variant[String[1], Stdlib::Absolutepath] $initdb_path = $postgresql::server::initdb_path, - Optional[String[1]] $lc_messages = $postgresql::server::lc_messages, - Optional[String[1]] $locale = $postgresql::server::locale, - Optional[String[1]] $logdir = $postgresql::server::logdir, - Boolean $manage_datadir = $postgresql::server::manage_datadir, - Boolean $manage_logdir = $postgresql::server::manage_logdir, - Boolean $manage_xlogdir = $postgresql::server::manage_xlogdir, - String[1] $module_workdir = $postgresql::server::module_workdir, - Boolean $needs_initdb = $postgresql::server::needs_initdb, - Variant[String[1], Stdlib::Port, Integer] $port = $postgresql::server::port, - Variant[String[1], Stdlib::Absolutepath] $psql_path = $postgresql::server::psql_path, - String[1] $user = $postgresql::server::user, - Optional[String[1]] $username = $postgresql::server::username, - Optional[String[1]] $xlogdir = $postgresql::server::xlogdir, + Optional[String[1]] $auth_host = $postgresql::server::auth_host, + Optional[String[1]] $auth_local = $postgresql::server::auth_local, + Optional[Boolean] $data_checksums = $postgresql::server::data_checksums, + String[1] $datadir = $postgresql::server::datadir, + Optional[String[1]] $encoding = $postgresql::server::encoding, + String[1] $group = $postgresql::server::group, + Variant[String[1], Stdlib::Absolutepath] $initdb_path = $postgresql::server::initdb_path, + Optional[String[1]] $lc_messages = $postgresql::server::lc_messages, + Optional[String[1]] $locale = $postgresql::server::locale, + Optional[String[1]] $logdir = $postgresql::server::logdir, + Boolean $manage_datadir = $postgresql::server::manage_datadir, + Boolean $manage_logdir = $postgresql::server::manage_logdir, + Boolean $manage_xlogdir = $postgresql::server::manage_xlogdir, + String[1] $module_workdir = $postgresql::server::module_workdir, + Boolean $needs_initdb = $postgresql::server::needs_initdb, + Variant[String[1], Stdlib::Port, Integer] $port = $postgresql::server::port, + Variant[String[1], Stdlib::Absolutepath] $psql_path = $postgresql::server::psql_path, + String[1] $user = $postgresql::server::user, + Optional[String[1]] $instance_username = $postgresql::server::instance_username, + Optional[String[1]] $xlogdir = $postgresql::server::xlogdir, ) { if $facts['os']['family'] == 'RedHat' and $facts['os']['selinux']['enabled'] == true { $seltype = 'postgresql_db_t' @@ -168,9 +168,9 @@ default => "--locale '${locale}'" } - $username_parameter = $username ? { + $username_parameter = $instance_username ? { undef => undef, - default => "--username '${username}'" + default => "--username '${instance_username}'" } $xlogdir_parameter = $xlogdir ? {