Skip to content

Commit b77c213

Browse files
committed
Merge pull request #565 from gerhardsam/create_role_before_db
create role before database
2 parents 8b9ebd8 + a246e58 commit b77c213

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

manifests/server/db.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
if ! defined(Postgresql::Server::Role[$user]) {
3030
postgresql::server::role { $user:
3131
password_hash => $password,
32+
before => Postgresql::Server::Database[$dbname],
3233
}
3334
}
3435

spec/unit/defines/server/db_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
it { is_expected.to contain_postgresql__server__db('test') }
3535
it { is_expected.to contain_postgresql__server__database('test').with_owner('tester') }
36-
it { is_expected.to contain_postgresql__server__role('test') }
36+
it { is_expected.to contain_postgresql__server__role('test').that_comes_before('Postgresql::Server::Database[test]') }
3737
it { is_expected.to contain_postgresql__server__database_grant('GRANT test - ALL - test') }
3838

3939
end

0 commit comments

Comments
 (0)