puppet: Make common::line use absolute paths

(imported from commit c9a3b184433709361243d5c3af13d290cc710ecf)
This commit is contained in:
Zev Benjamin 2013-02-07 18:03:42 -05:00
parent 3e7a6619bd
commit 10f3853abd
1 changed files with 4 additions and 4 deletions

View File

@ -27,13 +27,13 @@ define common::line($file, $line, $ensure = 'present') {
case $ensure {
default : { err ( "unknown ensure value '${ensure}'" ) }
present: {
exec { "echo '${line}' >> '${file}'":
unless => "grep -qFx '${line}' '${file}'"
exec { "/bin/echo '${line}' >> '${file}'":
unless => "/bin/grep -qFx '${line}' '${file}'"
}
}
absent: {
exec { "perl -ni -e 'print if \$_ ne \"${line}\n\";' '${file}'":
onlyif => "grep -qFx '${line}' '${file}'"
exec { "/usr/bin/perl -ni -e 'print if \$_ ne \"${line}\n\";' '${file}'":
onlyif => "/bin/grep -qFx '${line}' '${file}'"
}
}
}