Skip to content

Commit

Permalink
postgresql::database: remove absolute path to commands
Browse files Browse the repository at this point in the history
Paths must be set in a global Exec { path => ... }
  • Loading branch information
ckaenzig committed Apr 5, 2012
1 parent f3c0b6d commit 54701c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions manifests/database.pp
Expand Up @@ -26,15 +26,15 @@
case $ensure {
present: {
exec { "Create $name postgres db":
command => "/usr/bin/createdb $ownerstring $encodingstring $name -T $template",
command => "createdb $ownerstring $encodingstring $name -T $template",
user => "postgres",
unless => "test \$(psql -tA -c \"SELECT count(*)=1 FROM pg_catalog.pg_database where datname='${name}';\") = t",
require => Postgresql::Cluster["main"],
}
}
absent: {
exec { "Remove $name postgres db":
command => "/usr/bin/dropdb $name",
command => "dropdb $name",
user => "postgres",
onlyif => "test \$(psql -tA -c \"SELECT count(*)=1 FROM pg_catalog.pg_database where datname='${name}';\") = t",
require => Postgresql::Cluster["main"],
Expand All @@ -49,7 +49,7 @@
if $overwrite {
exec { "Drop database $name before import":
command => "dropdb ${name}",
onlyif => "/usr/bin/psql -l | grep '$name *|'",
onlyif => "psql -l | grep '$name *|'",
user => "postgres",
before => Exec["Create $name postgres db"],
require => Postgresql::Cluster["main"],
Expand Down

0 comments on commit 54701c2

Please sign in to comment.