Sha256: a726d28e9954c8970f51830a3eaf0be8bb70ea361c5a493069c68f89334b8e63

Contents?: true

Size: 592 Bytes

Versions: 10

Compression:

Stored size: 592 Bytes

Contents

# Find values via data lookups for class parameters
#
# Wraps the lookup() function for data lookups of class parameters without
# inline defaults.
#
Puppet::Functions.create_function(:'kafo_configure::dump_lookups') do
  dispatch :dump_lookups do
    param 'Array[String]', :parameters
    return_type 'Hash[String, Any]'
  end

  def dump_lookups(parameters)
    Hash[parameters.map { |param| [param, lookup(param)] }]
  end

  private

  def lookup(param)
    value = call_function('lookup', [param], 'default_value' => nil)
    value.respond_to?(:unwrap) ? value.unwrap : value
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kafo-7.6.0 modules/kafo_configure/lib/puppet/functions/kafo_configure/dump_lookups.rb
kafo-7.5.1 modules/kafo_configure/lib/puppet/functions/kafo_configure/dump_lookups.rb
kafo-7.5.0 modules/kafo_configure/lib/puppet/functions/kafo_configure/dump_lookups.rb
kafo-7.4.0 modules/kafo_configure/lib/puppet/functions/kafo_configure/dump_lookups.rb
kafo-7.3.0 modules/kafo_configure/lib/puppet/functions/kafo_configure/dump_lookups.rb
kafo-7.2.0 modules/kafo_configure/lib/puppet/functions/kafo_configure/dump_lookups.rb
kafo-7.1.0 modules/kafo_configure/lib/puppet/functions/kafo_configure/dump_lookups.rb
kafo-7.0.0 modules/kafo_configure/lib/puppet/functions/kafo_configure/dump_lookups.rb
kafo-6.5.0 modules/kafo_configure/lib/puppet/functions/kafo_configure/dump_lookups.rb
kafo-6.4.1 modules/kafo_configure/lib/puppet/functions/kafo_configure/dump_lookups.rb