From 95466322adc33bb1cf8d2c2da1dfb9a4e2c16303 Mon Sep 17 00:00:00 2001 From: Arne Teuke Date: Sat, 19 Apr 2025 12:34:50 +0200 Subject: [PATCH] add variables --- manifests/params.pp | 4 ++++ templates/postgresql.conf.erb | 9 +++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 4188c3f..9f5447c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -12,6 +12,8 @@ # @param [string] pl_source_range the source range for allowed clients # @param [boolean] pl_enable_fw whether to enable the firewall # @param [string] pl_listen_address which address should the service listen on +# @param [string] pl_listen_port which port should the service listen on +# @param [string] pl_max_conn maximum connections the service will accept # @summary Class contains all parameters for the postgresql_cd module. ############################################################################## class postgresql_cd::params ( @@ -31,6 +33,8 @@ class postgresql_cd::params ( # main config String $pl_listen_address = '*', + String $pl_listen_port = '5432', + String $pl_max_conn = '100', ) { $fqdn = $facts['networking']['fqdn'] diff --git a/templates/postgresql.conf.erb b/templates/postgresql.conf.erb index 39c151a..f479286 100644 --- a/templates/postgresql.conf.erb +++ b/templates/postgresql.conf.erb @@ -57,12 +57,9 @@ # - Connection Settings - -listen_addresses = '<%= @pl_listen_address %>' # what IP address(es) to listen on; - # comma-separated list of addresses; - # defaults to 'localhost'; use '*' for all - # (change requires restart) -#port = 5432 # (change requires restart) -max_connections = 100 # (change requires restart) +listen_addresses = '<%= @pl_listen_address %>' +port = <%= @pl_listen_port %> +max_connections = <%= @pl_max_conn %> #superuser_reserved_connections = 3 # (change requires restart) #unix_socket_directories = '/var/run/postgresql, /tmp' # comma-separated list of directories # (change requires restart)