1 Puppet::Type.newtype(:concat_fragment) do
2 @doc = "Create a concat fragment to be used by concat.
3 the `concat_fragment` type creates a file fragment to be collected by concat based on the tag.
4 The example is based on exported resources.
7 @@concat_fragment { \"uniqe_name_${::fqdn}\":
9 order => 10, # Optional. Default to 10
10 content => 'some content' # OR
11 content => template('template.erb') # OR
12 source => 'puppet:///path/to/file'
16 newparam(:name, :namevar => true) do
32 fail Puppet::ParseError, '$order is not a string or integer.' if !(val.is_a? String or val.is_a? Integer)
33 fail Puppet::ParseError, "Order cannot contain '/', ':', or '\n'." if val.to_s =~ /[:\n\/]/
38 desc "Tag name to be used by concat to collect all concat_fragments by tag name"
42 # Check if either source or content is set. raise error if none is set
43 fail Puppet::ParseError, "Set either 'source' or 'content'" if self[:source].nil? && self[:content].nil?
45 # Check if both are set, if so rais error
46 fail Puppet::ParseError, "Can't use 'source' and 'content' at the same time" if !self[:source].nil? && !self[:content].nil?