File tree Expand file tree Collapse file tree 6 files changed +8
-10
lines changed Expand file tree Collapse file tree 6 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,8 @@ def matches(value)
119
119
newvalues ( :true , :false )
120
120
end
121
121
122
+ autorequire ( :class ) { 'postgresql::server::passwd' }
123
+
122
124
def should_run_sql ( refreshing = false )
123
125
onlyif_param = @parameters [ :onlyif ]
124
126
unless_param = @parameters [ :unless ]
Original file line number Diff line number Diff line change 334
334
psql_path => $psql_path ,
335
335
unless => $_unless,
336
336
onlyif => $_onlyif,
337
- require => Class[' postgresql::server' ]
338
337
}
339
338
340
339
if ($role != undef and defined (Postgresql::Server::Role[$role ])) {
Original file line number Diff line number Diff line change 45
45
psql_group => $group ,
46
46
psql_path => $psql_path ,
47
47
onlyif => $onlyif ,
48
- require => Class[' postgresql::server' ]
49
48
}
50
49
51
50
if ($old_role != undef and defined (Postgresql::Server::Role[$old_role ])) {
Original file line number Diff line number Diff line change 47
47
psql_path => $psql_path ,
48
48
connect_settings => $connect_settings ,
49
49
cwd => $module_workdir ,
50
- require => [
51
- Postgresql_psql[" CREATE ROLE ${username} ENCRYPTED PASSWORD ****" ],
52
- Class[' postgresql::server' ],
53
- ],
50
+ require => Postgresql_psql[" CREATE ROLE ${username} ENCRYPTED PASSWORD ****" ],
54
51
}
55
52
56
53
if $ensure == ' present' {
72
69
command => " CREATE ROLE \" ${username} \" ${password_sql} ${login_sql} ${createrole_sql} ${createdb_sql} ${superuser_sql} ${replication_sql} CONNECTION LIMIT ${connection_limit} " ,
73
70
unless => " SELECT 1 FROM pg_roles WHERE rolname = '${username} '" ,
74
71
environment => $environment ,
75
- require => Class[ ' Postgresql::Server ' ],
72
+ require => [ ],
76
73
}
77
74
78
75
postgresql_psql {"ALTER ROLE \"${username}\" ${superuser_sql}" :
128
125
# ensure == absent
129
126
postgresql_psql { "DROP ROLE \"${username}\"" :
130
127
onlyif => " SELECT 1 FROM pg_roles WHERE rolname = '${username} '" ,
131
- require => Class[ ' Postgresql::Server ' ],
128
+ require => [ ],
132
129
}
133
130
}
134
131
}
Original file line number Diff line number Diff line change 40
40
postgresql_psql { "CREATE TABLESPACE \"${spcname}\"" :
41
41
command => " CREATE TABLESPACE \" ${spcname} \" LOCATION '${location} '" ,
42
42
unless => " SELECT 1 FROM pg_tablespace WHERE spcname = '${spcname} '" ,
43
- require => [Class[ ' postgresql::server ' ], File [$location ] ],
43
+ require => File [$location ],
44
44
}
45
45
46
46
if $owner {
Original file line number Diff line number Diff line change 52
52
it do
53
53
is_expected . to contain_postgresql_psql ( 'grant:test' ) . \
54
54
with_command ( /GRANT USAGE ON SEQUENCE "test" TO\s * "test"/m ) . \
55
- with_unless ( /SELECT 1 WHERE has_sequence_privilege\( 'test',\s * 'test', 'USAGE'\) /m )
55
+ with_unless ( /SELECT 1 WHERE has_sequence_privilege\( 'test',\s * 'test', 'USAGE'\) /m ) . \
56
+ that_requires ( 'Class[postgresql::server::passwd]' )
56
57
end
57
58
end
58
59
You can’t perform that action at this time.
0 commit comments