From 54701c2c411c7fa029e76a6387184c82ac5628f4 Mon Sep 17 00:00:00 2001 From: Christian Kaenzig Date: Thu, 5 Apr 2012 15:22:54 +0200 Subject: [PATCH] postgresql::database: remove absolute path to commands Paths must be set in a global Exec { path => ... } --- manifests/database.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/database.pp b/manifests/database.pp index ff1782c..16f52d0 100644 --- a/manifests/database.pp +++ b/manifests/database.pp @@ -26,7 +26,7 @@ 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"], @@ -34,7 +34,7 @@ } 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"], @@ -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"],