Merge pull request #747 from cyberious/default_connect_settings

Fix issues with missing parameters in `server` class
This commit is contained in:
Bryan Jen 2016-03-01 12:10:05 -07:00
commit f1bd5a9063
5 changed files with 14 additions and 14 deletions

View file

@ -605,6 +605,10 @@ The name of the PostgreSQL Python package.
Specifies the name of the default database to connect with. On most systems this is "postgres".
##### `default_connect_settings`
Specifies a hash of environment variables used when connecting to a remote server. Becomes the default for other defined-types. i.e. `postgresql::server::role`
##### `encoding`
Sets the default encoding for all databases created with this module. On certain operating systems this is also used during the `template1` initialization, so it becomes a default outside of the module as well. Default: undef.

View file

@ -27,7 +27,7 @@ class postgresql::globals (
$pg_ident_conf_path = undef,
$postgresql_conf_path = undef,
$recovery_conf_path = undef,
$default_connect_settings = undef,
$default_connect_settings = {},
$pg_hba_conf_defaults = undef,

View file

@ -18,7 +18,7 @@ class postgresql::server (
$service_reload = $postgresql::params::service_reload,
$service_status = $postgresql::params::service_status,
$default_database = $postgresql::params::default_database,
$default_connect_settings = $postgresql::globals::default_connect_settings,
$listen_addresses = $postgresql::params::listen_addresses,
$port = $postgresql::params::port,
$ip_mask_deny_postgres_user = $postgresql::params::ip_mask_deny_postgres_user,

View file

@ -24,8 +24,7 @@ describe 'postgresql::server::database', :type => :define do
it { is_expected.to contain_postgresql_psql("Create db 'test'") }
context "with comment set to 'test comment'" do
let (:params) {{ :comment => 'test comment',
:connect_settings => {} }}
let (:params) {{ :comment => 'test comment' }}
it { is_expected.to contain_postgresql_psql("COMMENT ON DATABASE \"test\" IS 'test comment'").with_connect_settings( {} ) }
end

View file

@ -20,7 +20,6 @@ describe 'postgresql::server::role', :type => :define do
let :params do
{
:password_hash => 'new-pa$s',
:connect_settings => {},
}
end
@ -35,7 +34,6 @@ describe 'postgresql::server::role', :type => :define do
'environment' => "NEWPGPASSWD=new-pa$s",
'unless' => "SELECT rolname FROM pg_roles WHERE rolname='test'",
'port' => "5432",
'connect_settings' => {},
})
end
it 'should have alter role for "test" user with password as ****' do
@ -44,7 +42,6 @@ describe 'postgresql::server::role', :type => :define do
'environment' => "NEWPGPASSWD=new-pa$s",
'unless' => "SELECT usename FROM pg_shadow WHERE usename='test' and passwd='md5b6f7fcbbabb4befde4588a26c1cfd2fa'",
'port' => "5432",
'connect_settings' => {},
})
end