1 # == Define: concat::fragment
3 # Creates a concat_fragment in the catalogue
8 # The file that these fragments belong to
10 # If present puts the content into the file
12 # If content was not specified, use the source
14 # By default all files gets a 10_ prefix in the directory you can set it to
15 # anything else using this to influence the order of the content in the file
17 define concat::fragment(
24 validate_string($target)
27 warning('The $ensure parameter to concat::fragment is deprecated and has no effect.')
30 validate_string($content)
31 if !(is_string($source) or is_array($source)) {
32 fail('$source is not a string or an Array.')
35 if !(is_string($order) or is_integer($order)) {
36 fail('$order is not a string or integer.')
37 } elsif (is_string($order) and $order =~ /[:\n\/]/) {
38 fail("Order cannot contain '/', ':', or '\n'.")
41 if ! ($content or $source) {
42 crit('No content, source or symlink specified')
43 } elsif ($content and $source) {
44 fail("Can't use 'source' and 'content' at the same time")
47 $safe_target_name = regsubst($target, '[/:\n\s]', '_', 'GM')
49 concat_fragment { $name:
50 tag => $safe_target_name,