Sha256: b02c3a559cc522c2a97e06df53e6727d6896f32022c4fb628ddb3844e9674516

Contents?: true

Size: 1.38 KB

Versions: 66

Compression:

Stored size: 1.38 KB

Contents

require 'hiera_puppet'

module Puppet::Parser::Functions
  newfunction(:hiera_hash, :type => :rvalue, :arity => -2, :doc => 
  "Returns a merged hash of matches from throughout the hierarchy. In cases where two or 
  more hashes share keys, the hierarchy  order determines which key/value pair will be 
  used in the returned hash, with the pair in the highest priority data source winning.
  
  In addition to the required `key` argument, `hiera_hash` accepts two additional 
  arguments:
  
  - a `default` argument in the second position, providing a  hash to be returned in the 
  absence of any matches for the `key` argument
  - an `override` argument in the third position, providing  a data source to insert at 
  the top of the hierarchy, even if it would not ordinarily match during a Hiera data 
  source lookup. If Hiera doesn't find a match in the named override data source, it will 
  continue to search through the rest of the hierarchy.
    
  `hiera_hash` expects that all values returned will be hashes. If any of the values 
  found in the data sources are strings or arrays, puppet will raise a type mismatch error.

  More thorough examples of `hiera_hash` are available at:  
  <http://docs.puppetlabs.com/hiera/1/puppet.html#hiera-lookup-functions>
  ") do |*args|
    key, default, override = HieraPuppet.parse_args(args)
    HieraPuppet.lookup(key, default, self, override, :hash)
  end
end

Version data entries

66 entries across 66 versions & 2 rubygems

Version Path
puppet-retrospec-0.12.2 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/hiera_hash.rb
puppet-retrospec-0.12.1 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/hiera_hash.rb
puppet-retrospec-0.12.0 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/hiera_hash.rb
puppet-retrospec-0.11.0 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/hiera_hash.rb
puppet-retrospec-0.10.0 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/hiera_hash.rb
puppet-retrospec-0.9.1 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/hiera_hash.rb
puppet-retrospec-0.9.0 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/hiera_hash.rb
puppet-retrospec-0.8.1 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/hiera_hash.rb
puppet-retrospec-0.8.0 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/hiera_hash.rb
puppet-retrospec-0.7.3 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/hiera_hash.rb
puppet-retrospec-0.7.2 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/hiera_hash.rb
puppet-3.7.4 lib/puppet/parser/functions/hiera_hash.rb
puppet-3.7.4-x86-mingw32 lib/puppet/parser/functions/hiera_hash.rb
puppet-3.7.4-x64-mingw32 lib/puppet/parser/functions/hiera_hash.rb
puppet-3.7.3 lib/puppet/parser/functions/hiera_hash.rb
puppet-3.7.3-x86-mingw32 lib/puppet/parser/functions/hiera_hash.rb
puppet-3.7.3-x64-mingw32 lib/puppet/parser/functions/hiera_hash.rb
puppet-3.7.2 lib/puppet/parser/functions/hiera_hash.rb
puppet-3.7.2-x86-mingw32 lib/puppet/parser/functions/hiera_hash.rb
puppet-3.7.2-x64-mingw32 lib/puppet/parser/functions/hiera_hash.rb