diff --git a/CHANGELOG.md b/CHANGELOG.md index a3875fc..3a731a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,28 @@ +## 2015-10-09 Release 0.3.0 +### Summary +Better support for 1.7 release, possible impacting changes included! + +### Changes + - Changed default of global pooler to conservative value of session instead of the more aggressive transaction value. Though this is not a breaking change, it can affect performance greatly. To preserve the old behavior, please set overide the config params. Keep in mind this is a deep merge of the config_params variable with the defaults. Example hieradata below: + + ``` + pgbouncer::config_params + pool_mode: 'transaction' + ``` + Alternatively you can override the pool mode at the user level in 1.7 with the below syntax in your user array: + + ``` + pgbouncer::userlist: + - user: 'username' + password: 'password' + pool_mode: 'transaction' + ``` + - Optional arguments are added to the pgbouncer.ini databases section for port + - Optional arguments are added to the pgbouncer.ini databases section for auth_user + - Optional arguments are added to the pgbouncer.ini databases section for auth_pass + - Optional arguments are added to the pgbouncer.ini databases section for pool_size + - A users section has been added to the pgbouncer.ini + ## 2015-10-09 Release 0.2.7 ### Summary New OS Support and bugfix release diff --git a/manifests/init.pp b/manifests/init.pp index 2897f75..02a06ee 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -52,9 +52,6 @@ # dest_db: postgres # auth_user: postgres # -# dbtmpfile is the temporary file the module uses to stitch together pieces -# using puppet concat. It's located in the tmp directory by default -# # paramtmpfile is the temporary file the module uses to stitch together pieces # using puppet concat. Its located in the tmp directory by default. # @@ -86,7 +83,6 @@ class pgbouncer ( $userlist = $pgbouncer::params::userlist, $databases = $pgbouncer::params::databases, - $dbtmpfile = $pgbouncer::params::dbtmpfile, $paramtmpfile = $pgbouncer::params::paramtmpfile, $default_config_params = $pgbouncer::params::default_config_params, $config_params = $pgbouncer::params::config_params, @@ -133,7 +129,7 @@ } # build the pgbouncer parameter piece of the config file - concat::fragment { $paramtmpfile: + concat::fragment { "${paramtmpfile}_params": target => $conffile, content => template('pgbouncer/pgbouncer.ini.param.part.erb'), order => '03', @@ -158,11 +154,18 @@ } #build the databases base piece of the config file - concat::fragment { $dbtmpfile: + concat::fragment { "${paramtmpfile}_database": target => $conffile, content => template('pgbouncer/pgbouncer.ini.databases.part1.erb'), order => '01', } + + #build the users base piece of the config file + concat::fragment { "${paramtmpfile}_users": + target => $conffile, + content => template('pgbouncer/pgbouncer.ini.users.part1.erb'), + order => '05', + } # check if we have a database list and create entries if $databases { diff --git a/manifests/params.pp b/manifests/params.pp index f545f5c..8ce0596 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -6,7 +6,6 @@ $userlist = [] $databases = [] - $dbtmpfile = '/tmp/pgbouncer-dbtmpfile' $paramtmpfile = '/tmp/pgbouncer-paramtmpfile' $config_params = undef $pgbouncer_package_name = 'pgbouncer' diff --git a/manifests/userlist.pp b/manifests/userlist.pp index d79b842..29040bd 100644 --- a/manifests/userlist.pp +++ b/manifests/userlist.pp @@ -15,10 +15,10 @@ order => '01', } - concat::fragment { "${paramtmpfile}_users": + concat::fragment { "${auth_list[0]}_users": target => $::pgbouncer::conffile, - content => template('pgbouncer/pgbouncer.ini.users.part.erb'), - order => '04', + content => template('pgbouncer/pgbouncer.ini.users.part2.erb'), + order => '06', } } diff --git a/metadata.json b/metadata.json index 909dc06..770e7bc 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "covermymeds-pgbouncer", - "version": "0.2.7", + "version": "0.3.0", "author": "CJ Estel", "license": "GPL-3.0+", "summary": "Deploys pgbouncer", diff --git a/templates/pgbouncer.ini.users.part1.erb b/templates/pgbouncer.ini.users.part1.erb new file mode 100644 index 0000000..d42025f --- /dev/null +++ b/templates/pgbouncer.ini.users.part1.erb @@ -0,0 +1,4 @@ +;; Section autogenerated by puppet module +;; Do not manually update + +[users] diff --git a/templates/pgbouncer.ini.users.part.erb b/templates/pgbouncer.ini.users.part2.erb similarity index 86% rename from templates/pgbouncer.ini.users.part.erb rename to templates/pgbouncer.ini.users.part2.erb index 7c3786c..9b68a39 100644 --- a/templates/pgbouncer.ini.users.part.erb +++ b/templates/pgbouncer.ini.users.part2.erb @@ -1,4 +1,4 @@ -[users] +; Created from: <%= @name %> <% if @auth_list -%> <% @auth_list.each do |entry| -%> <% if entry['pool_mode'] %><%= %Q|#{entry['user']} = pool_mode=#{entry['pool_mode']}| %><% end %>