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:
Etienne Pelletier 2012-11-08 12:50:08 -06:00
parent ef14e8d26c
commit 9adcd182f8

View file

@ -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}":