Added check before adding postgresql::user
This is to make sure there are no duplicate definitions when creating multiple databases owned by the same user.
This commit is contained in:
parent
ef14e8d26c
commit
9adcd182f8
1 changed files with 8 additions and 6 deletions
|
@ -46,12 +46,14 @@ define postgresql::db (
|
|||
require => Class['postgresql::server'],
|
||||
}
|
||||
|
||||
postgresql::database_user { $user:
|
||||
# TODO: ensure is not yet supported
|
||||
#ensure => present,
|
||||
password_hash => $password,
|
||||
#provider => 'postgresql',
|
||||
require => Postgresql::Database[$name],
|
||||
if ! defined(Postgresql::Database_user[$user]) {
|
||||
postgresql::database_user { $user:
|
||||
# TODO: ensure is not yet supported
|
||||
#ensure => present,
|
||||
password_hash => $password,
|
||||
#provider => 'postgresql',
|
||||
require => Postgresql::Database[$name],
|
||||
}
|
||||
}
|
||||
|
||||
postgresql::database_grant { "GRANT ${user} - ${grant} - ${name}":
|
||||
|
|
Loading…
Reference in a new issue