summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authordavid <david@f03ff2f1-f02d-0410-970d-b9634babeaa1>2007-08-06 10:16:33 +0000
committerdavid <david@f03ff2f1-f02d-0410-970d-b9634babeaa1>2007-08-06 10:16:33 +0000
commit8c60b89c054d3ac391726385a26daa12cd4bf059 (patch)
treea78c2187727a41e43fdf58925606c69847ae3c7e /manifests
parentc85903a0b309299183c3fd58d53121a0df059e67 (diff)
support a footer file too
git-svn-id: http://club.black.co.at:82/svn/manifests/trunk@174 f03ff2f1-f02d-0410-970d-b9634babeaa1
Diffstat (limited to 'manifests')
-rw-r--r--manifests/defines/concatenated_file.pp6
1 files changed, 4 insertions, 2 deletions
diff --git a/manifests/defines/concatenated_file.pp b/manifests/defines/concatenated_file.pp
index 7162970..e701469 100644
--- a/manifests/defines/concatenated_file.pp
+++ b/manifests/defines/concatenated_file.pp
@@ -18,6 +18,8 @@ define concatenated_file (
$dir,
# a file with content to prepend
$header = '',
+ # a file with content to append
+ $footer = '',
$mode = 0644, $owner = root, $group = root
)
{
@@ -33,8 +35,8 @@ define concatenated_file (
mode => $mode, owner => $owner, group => $group;
}
- # if there is a header file, prepend it
- $header_cmd = $header? { '' => '', default => "| cat ${header} - " }
+ # if there is a header or footer file, add it
+ $additional_cmd = "$header$footer" ? { '' => '', default => "| cat '${header}' - '${footer}' " }
# use >| to force clobbering the target file
exec { "/usr/bin/find ${dir} -maxdepth 1 -type f ! -name '*puppettmp' -print0 | sort -z | xargs -0 cat ${header_cmd} >| ${name}.puppettmp":