Puppet Function: icinga2::icinga2_attributes
- Defined in:
- lib/puppet/functions/icinga2/icinga2_attributes.rb
- Function type:
- Ruby 4.x API
Summary
Summarise what the function does hereOverview
—- original file header —-
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/puppet/functions/icinga2/icinga2_attributes.rb', line 16 Puppet::Functions.create_function(:'icinga2::icinga2_attributes') do # @param args # The original array of arguments. Port this to individually managed params # to get the full benefit of the modern function API. # # @return [Data type] # Describe what the function returns here # dispatch :default_impl do # Call the method named 'default_impl' when this is matched # Port this to match individual params for better type safety repeated_param 'Any', :args end def default_impl(*args) raise Puppet::ParseError, 'icinga2_atributes(): Must provide at least one argument.' if args.length > 4 || args.length < 1 if args[1] indent = args[1] else indent = 0 end if args[2] globals = args[2].concat(lookupvar('::icinga2::_reserved')) else globals = lookupvar('::icinga2::_reserved') end if args[3] constants = args[3].merge(lookupvar('::icinga2::_constants')) else constants = lookupvar('::icinga2::_constants') end Puppet::Icinga2::Utils.attributes(args[0], globals, constants, indent) end end |