diff options
Diffstat (limited to 'manifests/defines')
-rw-r--r-- | manifests/defines/concatenated_file.pp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/manifests/defines/concatenated_file.pp b/manifests/defines/concatenated_file.pp index e701469..865a1ee 100644 --- a/manifests/defines/concatenated_file.pp +++ b/manifests/defines/concatenated_file.pp @@ -36,7 +36,16 @@ define concatenated_file ( } # if there is a header or footer file, add it - $additional_cmd = "$header$footer" ? { '' => '', default => "| cat '${header}' - '${footer}' " } + $additional_cmd = "$header" ? { + '' => $footer ? { + '' => '', + default => "| cat - '${footer}' " + }, + default => $footer ? { + '' => "| cat '${header}' - ", + 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": |