Skip to content

Commit

Permalink
Merge pull request #13 from covermymeds/cje-usersinfo
Browse files Browse the repository at this point in the history
Cje usersinfo
  • Loading branch information
cjestel committed Nov 19, 2015
2 parents ae93e24 + b68ec8a commit d70336c
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 12 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 9 additions & 6 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand All @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

$userlist = []
$databases = []
$dbtmpfile = '/tmp/pgbouncer-dbtmpfile'
$paramtmpfile = '/tmp/pgbouncer-paramtmpfile'
$config_params = undef
$pgbouncer_package_name = 'pgbouncer'
Expand Down
6 changes: 3 additions & 3 deletions manifests/userlist.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}

}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 4 additions & 0 deletions templates/pgbouncer.ini.users.part1.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
;; Section autogenerated by puppet module
;; Do not manually update

[users]
Original file line number Diff line number Diff line change
@@ -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 %>
Expand Down

0 comments on commit d70336c

Please sign in to comment.