File tree Expand file tree Collapse file tree 5 files changed +21
-22
lines changed
unit/puppet/provider/postgresql_conn_validator Expand file tree Collapse file tree 5 files changed +21
-22
lines changed Original file line number Diff line number Diff line change 31
31
# Without it, we may continue doing more work before the database is
32
32
# prepared leading to a nasty race condition.
33
33
postgresql_conn_validator { 'validate_service_is_running' :
34
- run_as => $user ,
35
- db_name => $default_database ,
36
- port => $port ,
37
- sleep => 1,
38
- tries => 60,
39
- psql_path => $psql_path ,
40
- require => Service[' postgresqld' ],
41
- before => Anchor[' postgresql::server::service::end' ]
34
+ run_as => $user ,
35
+ db_name => $default_database ,
36
+ port => $port ,
37
+ sleep => 1,
38
+ tries => 60,
39
+ psql_path => $psql_path ,
40
+ require => Service[' postgresqld' ],
41
+ before => Anchor[' postgresql::server::service::end' ]
42
42
}
43
43
Postgresql::Server::Database <| title == $default_database |> -> Postgresql_conn_validator[' validate_service_is_running' ]
44
44
}
Original file line number Diff line number Diff line change 18
18
include postgresql::client
19
19
include postgresql::params
20
20
21
- warning (" postgresql::validate_db_connection is deprecated, please use postgresql_conn_validator." )
21
+ warning (' postgresql::validate_db_connection is deprecated, please use postgresql_conn_validator.' )
22
22
23
23
$psql_path = $postgresql::params::psql_path
24
24
$module_workdir = $postgresql::params::module_workdir
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ class { 'postgresql::server':
22
22
apply_manifest ( pp , :catch_failures => true )
23
23
apply_manifest ( pp , :catch_changes => true )
24
24
25
-
26
25
# Verify that the postgres password works
27
26
shell ( "echo 'localhost:*:*:postgres:\' space password\' ' > /root/.pgpass" )
28
27
shell ( "chmod 600 /root/.pgpass" )
Original file line number Diff line number Diff line change @@ -10,13 +10,13 @@ class { 'postgresql::server':
10
10
password_hash => postgresql_password('testuser','test1'),
11
11
}->
12
12
postgresql::server::database { 'testdb':
13
- owner => 'testuser',
13
+ owner => 'testuser',
14
14
require => Postgresql::Server::Role['testuser']
15
15
}->
16
16
postgresql::server::database_grant { 'allow connect for testuser':
17
17
privilege => 'CONNECT',
18
- db => 'testdb',
19
- role => 'testuser',
18
+ db => 'testdb',
19
+ role => 'testuser',
20
20
}
21
21
22
22
EOS
@@ -28,11 +28,11 @@ class { 'postgresql::server':
28
28
pp = <<-EOS
29
29
#{ install_pp } ->
30
30
postgresql_conn_validator { 'validate this':
31
- db_name => 'testdb',
31
+ db_name => 'testdb',
32
32
db_username => 'testuser',
33
33
db_password => 'test1',
34
- host => 'localhost',
35
- psql_path => '/usr/bin/psql',
34
+ host => 'localhost',
35
+ psql_path => '/usr/bin/psql',
36
36
}
37
37
EOS
38
38
@@ -65,7 +65,7 @@ class { 'postgresql::server':
65
65
#{ install_pp } ->
66
66
postgresql_conn_validator { 'validate this':
67
67
psql_path => '/usr/bin/psql',
68
- tries => 3
68
+ tries => 3
69
69
}
70
70
EOS
71
71
Original file line number Diff line number Diff line change 9
9
10
10
let ( :attributes ) do
11
11
{
12
- :psql_path => '/usr/bin/psql' ,
13
- :host => 'db.test.com' ,
14
- :port => '4444' ,
12
+ :psql_path => '/usr/bin/psql' ,
13
+ :host => 'db.test.com' ,
14
+ :port => '4444' ,
15
15
:db_username => 'testuser' ,
16
16
:db_password => 'testpass'
17
17
}
37
37
{
38
38
:connect_settings => {
39
39
:PGPASSWORD => 'testpass' ,
40
- :PGHOST => 'db.test.com' ,
41
- :PGPORT => '1234'
40
+ :PGHOST => 'db.test.com' ,
41
+ :PGPORT => '1234'
42
42
}
43
43
}
44
44
end
You can’t perform that action at this time.
0 commit comments