Skip to content

Commit

Permalink
transaction mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jordiprats committed Jun 17, 2020
1 parent c335a34 commit 7efba06
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
1 change: 0 additions & 1 deletion examples/pgbouncer_session_demo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,4 @@
realize_dbs_tag => 'demopgbouncer',
set_pgbouncer_password => 'pgbouncer',
enable_auth_query => true,
server_fast_close => true,
}
65 changes: 65 additions & 0 deletions examples/pgbouncer_transaction_demo.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# [root@ip-172-31-33-72 puppet-masterless]# ./localpuppetmaster.sh -d /tmp/postgres -r https://github.com/jordiprats/eyp-postgresql -s /tmp/postgres/modules/postgresql/examples/pgbouncer_standalone_demo.pp
#
# Checking Puppetfile syntax:
# Syntax OK
# Cleanup postgresql module
# Notice: Preparing to uninstall 'eyp-postgresql' ...
# Removed 'eyp-postgresql' (v0.5.1) from /tmp/postgres/modules
# Installing puppet module using a Puppetfile
# Installing dependencies
# Dependencies installed
# Warning: The string '3787.804688' was automatically coerced to the numerical value 3787.804688 (file: /tmp/postgres/modules/postgresql/manifests/init.pp, line: 33, column: 62)
# Warning: The string '3787.804688' was automatically coerced to the numerical value 3787.804688 (file: /tmp/postgres/modules/postgresql/manifests/init.pp, line: 34, column: 70)
# Warning: The string '4096' was automatically coerced to the numerical value 4096 (file: /tmp/postgres/modules/postgresql/manifests/init.pp, line: 34, column: 110)
# Warning: The string '3787.804688' was automatically coerced to the numerical value 3787.804688 (file: /tmp/postgres/modules/postgresql/manifests/init.pp, line: 107, column: 77)
# Warning: The string '946.951172' was automatically coerced to the numerical value 946.951172 (file: /tmp/postgres/modules/postgresql/manifests/init.pp, line: 118, column: 77)
# Notice: Compiled catalog for ip-172-31-33-72.eu-west-1.compute.internal in environment production in 0.37 seconds
# Notice: Applied catalog in 0.73 seconds
# [root@ip-172-31-33-72 puppet-masterless]# psql -U demo -p 6432 -h 127.0.0.1 -d demo
# Password for user demo:
# psql (11.8)
# Type "help" for help.
#
# demo=>


postgresql::role { 'demo':
password => 'demopass',
}

postgresql::db { 'demo':
owner => 'demo',
pgbouncer_tag => 'demopgbouncer',
}

postgresql::hba_rule { 'postgres trust localhost':
user => 'postgres',
database => 'all',
address => '127.0.0.1/32',
auth_method => 'trust',
order => 0,
}

postgresql::hba_rule { 'all':
user => 'all',
database => 'all',
address => "127.0.0.1/32",
}

class { 'postgresql':
wal_level => 'hot_standby',
max_wal_senders => '3',
checkpoint_segments => '8',
wal_keep_segments => '8',
version => '11',
add_nagios_checks => false,
add_hba_default_localhost_rules => false,
}

class { 'postgresql::pgbouncer':
pool_mode => 'transaction',
default_pool_size => 20,
realize_dbs_tag => 'demopgbouncer',
set_pgbouncer_password => 'pgbouncer',
enable_auth_query => true,
}

0 comments on commit 7efba06

Please sign in to comment.