puppetlabs/puppet-postgresql — pull request #67 by grundic (2013-01-12 13:47:54+00:00)
Title: User role/provider, auges usage

Hello!

I've implemented some stuff. Maybe it need some improvement.

So, now it's possible to mange postgresql users via custom type. It's possible now to correctly update existing user parameters.

Usage is simple as
```ruby
pg_user { 'new_user':
ensure => present,
password => '12345',
superuser => true,
connlimit => 13,
createdb => true,
}
```

Also, I've implemented managing of postgresql.conf parameters via augeas.

```ruby

$au_pg_hba_conf = {
"main" => {
type => 'host',
database => 'all',
user => 'all',
address => '0.0.0.0/0',
method => 'md5',
},
}

class { 'postgresql::server':
config_hash => {
'postgres_password' => $postgres_password,
'au_pg_hba_conf' => $au_pg_hba_conf,
'au_postgresql_conf' => {
"listen_addresses" => { value => "\"'*'\""},
"max_connections" => { value => "300"},
"shared_buffers" => { value => "16GB"},
"effective_cache_size" => { value => "32GB"},
"log_line_prefix" => { value => "\"'%t:%r:%u@%d:[%p]: '\""},
"maintenance_work_mem" => { value => "320MB"},
"checkpoint_segments" => { value => "64"},
"checkpoint_completion_target" => { value => "0.9"},
"wal_buffers" => { value => "16MB"},
"wal_sync_method" => { value => "fdatasync"},
"work_mem " => { value => "1024MB"},
"max_prepared_transactions" => { value => "100"},
"autovacuum_naptime" => { value => "1h"},
"autovacuum_vacuum_threshold" => { value => "100000"},
"autovacuum_analyze_threshold" => { value => "10000"},
"autovacuum_vacuum_scale_factor" => { value => "0.4"},
"autovacuum_analyze_scale_factor" => { value => "0.3"},
"default_statistics_target" => { value => "10"},
},
},
}
```

That is, it's possible to change any value you want.
If you have any questions or my code is not perfect :) - feel free to comment or ask.