X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fconcat%2Fmanifests%2Ffragment.pp;h=8d9a0a00ccdcc7936ee4299e0db96f0a0ce2fb1f;hp=e30732ca8cd2e33099a944c1f04ae28a3794ac3b;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/concat/manifests/fragment.pp b/3rdparty/modules/concat/manifests/fragment.pp index e30732ca8..8d9a0a00c 100644 --- a/3rdparty/modules/concat/manifests/fragment.pp +++ b/3rdparty/modules/concat/manifests/fragment.pp @@ -1,11 +1,19 @@ -# Creates a concat_fragment in the catalogue +# @summary +# Manages a fragment of text to be compiled into a file. +# +# @param content +# Supplies the content of the fragment. Note: You must supply either a content parameter or a source parameter. # -# @param target The file that these fragments belong to -# @param content If present puts the content into the file -# @param source If content was not specified, use the source # @param order -# By default all files gets a 10_ prefix in the directory you can set it to -# anything else using this to influence the order of the content in the file +# Reorders your fragments within the destination file. Fragments that share the same order number are ordered by name. The string +# option is recommended. +# +# @param source +# Specifies a file to read into the content of the fragment. Note: You must supply either a content parameter or a source parameter. +# Valid options: a string or an array, containing one or more Puppet URLs. +# +# @param target +# Specifies the destination file of the fragment. Valid options: a string containing the path or title of the parent concat resource. # define concat::fragment( String $target, @@ -15,17 +23,17 @@ define concat::fragment( ) { $resource = 'Concat::Fragment' - if (is_string($order) and $order =~ /[:\n\/]/) { - fail("${resource}['${title}']: 'order' cannot contain '/', ':', or '\n'.") + if ($order =~ String and $order =~ /[:\n\/]/) { + fail(translate("%{_resource}['%{_title}']: 'order' cannot contain '/', ':', or '\\n'.", {'_resource' => $resource, '_title' => $title})) } if ! ($content or $source) { crit('No content, source or symlink specified') } elsif ($content and $source) { - fail("${resource}['${title}']: Can't use 'source' and 'content' at the same time.") + fail(translate("%{_resource}['%{_title}']: Can't use 'source' and 'content' at the same time.", {'_resource' => $resource, '_title' => $title})) } - $safe_target_name = regsubst($target, '[/:~\n\s\+\*\(\)@]', '_', 'GM') + $safe_target_name = regsubst($target, '[\\\\/:~\n\s\+\*\(\)@]', '_', 'GM') concat_fragment { $name: target => $target,