Merge pull request #32 from antaflos/quote-dbname
Properly quote database name when using postgresql::psql
This commit is contained in:
commit
7612cb9539
2 changed files with 2 additions and 2 deletions
|
@ -38,7 +38,7 @@ define postgresql::database(
|
||||||
|
|
||||||
# This will prevent users from connecting to the database unless they've been
|
# This will prevent users from connecting to the database unless they've been
|
||||||
# granted privileges.
|
# granted privileges.
|
||||||
postgresql::psql {"REVOKE CONNECT ON DATABASE ${dbname} FROM public":
|
postgresql::psql {"REVOKE CONNECT ON DATABASE \"${dbname}\" FROM public":
|
||||||
db => 'postgres',
|
db => 'postgres',
|
||||||
user => 'postgres',
|
user => 'postgres',
|
||||||
unless => 'SELECT 1 where 1 = 0',
|
unless => 'SELECT 1 where 1 = 0',
|
||||||
|
|
|
@ -49,7 +49,7 @@ define postgresql::database_grant(
|
||||||
default => $privilege,
|
default => $privilege,
|
||||||
}
|
}
|
||||||
|
|
||||||
postgresql::psql { "GRANT ${privilege} ON database ${db} TO \"${role}\"":
|
postgresql::psql { "GRANT ${privilege} ON database \"${db}\" TO \"${role}\"":
|
||||||
db => $psql_db,
|
db => $psql_db,
|
||||||
user => $psql_user,
|
user => $psql_user,
|
||||||
unless => "SELECT 1 WHERE has_database_privilege('${role}', '${db}', '${unless_privilege}')",
|
unless => "SELECT 1 WHERE has_database_privilege('${role}', '${db}', '${unless_privilege}')",
|
||||||
|
|
Loading…
Reference in a new issue