Sha256: 6622ee9f243d82e0d901f77207207fd0f490388618ec26fa5260b5b3013e2b5f

Contents?: true

Size: 1.51 KB

Versions: 21

Compression:

Stored size: 1.51 KB

Contents

require 'hiera_puppet'

module Puppet::Parser::Functions
  newfunction(:hiera_array, :type => :rvalue, :arity => -2,:doc => "Returns all 
  matches throughout the hierarchy --- not just the first match --- as a flattened array of unique values.
  If any of the matched values are arrays, they're flattened and included in the results.

  The function can be called in one of three ways:
  1. Using 1 to 3 arguments where the arguments are:
     'key'      [String] Required
           The key to lookup.
     'default`  [Any] Optional
           A value to return when there's no match for `key`. Optional
     `override` [Any] Optional
           An argument in the third position, providing a data source
           to consult for matching values, even if it would not ordinarily be
           part of the matched hierarchy. If Hiera doesn't find a matching key
           in the named override data source, it will continue to search through the
           rest of the hierarchy.

  2. Using a 'key' and an optional 'override' parameter like in #1 but with a block to
     provide the default value. The block is called with one parameter (the key) and
     should return the value.

  3. Like #1 but with all arguments passed in an array.

  If any matched value is a hash, puppet will raise a type mismatch error.

  More thorough examples of `hiera` are available at:  
  <http://docs.puppetlabs.com/hiera/1/puppet.html#hiera-lookup-functions>
  ") do |*args|
    function_fail(["hiera_array() has been converted to 4x API"])
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
puppet-4.2.3 lib/puppet/parser/functions/hiera_array.rb
puppet-4.2.3-x86-mingw32 lib/puppet/parser/functions/hiera_array.rb
puppet-4.2.3-x64-mingw32 lib/puppet/parser/functions/hiera_array.rb
puppet-4.2.2 lib/puppet/parser/functions/hiera_array.rb
puppet-4.2.2-x86-mingw32 lib/puppet/parser/functions/hiera_array.rb
puppet-4.2.2-x64-mingw32 lib/puppet/parser/functions/hiera_array.rb
puppet-4.2.1 lib/puppet/parser/functions/hiera_array.rb
puppet-4.2.1-x86-mingw32 lib/puppet/parser/functions/hiera_array.rb
puppet-4.2.1-x64-mingw32 lib/puppet/parser/functions/hiera_array.rb
puppet-4.2.0 lib/puppet/parser/functions/hiera_array.rb
puppet-4.2.0-x86-mingw32 lib/puppet/parser/functions/hiera_array.rb
puppet-4.2.0-x64-mingw32 lib/puppet/parser/functions/hiera_array.rb
puppet-4.1.0 lib/puppet/parser/functions/hiera_array.rb
puppet-4.1.0-x86-mingw32 lib/puppet/parser/functions/hiera_array.rb
puppet-4.1.0-x64-mingw32 lib/puppet/parser/functions/hiera_array.rb
puppet-4.0.0 lib/puppet/parser/functions/hiera_array.rb
puppet-4.0.0-x86-mingw32 lib/puppet/parser/functions/hiera_array.rb
puppet-4.0.0-x64-mingw32 lib/puppet/parser/functions/hiera_array.rb
puppet-4.0.0.rc1 lib/puppet/parser/functions/hiera_array.rb
puppet-4.0.0.rc1-x86-mingw32 lib/puppet/parser/functions/hiera_array.rb