Sha256: 287a16a10023f816211a6b5c706ac4b2de66c3a95babb2363cfdf86e9f980cf6
Contents?: true
Size: 1.01 KB
Versions: 3
Compression:
Stored size: 1.01 KB
Contents
# # global_hash.rb # # See: global_param.rb # module Puppet::Parser::Functions newfunction(:global_hash, :type => :rvalue, :doc => <<-EOS This function performs a lookup for a variable value in various locations: See: global_params() If no value is found in the defined sources, it returns an empty hash ({}) EOS ) do |args| value = nil CORL.run do raise(Puppet::ParseError, "global_hash(): Define at least the variable name " + "given (#{args.size} for 1)") if args.size < 1 var_name = args[0] default = ( args.size > 1 ? args[1] : {} ) options = ( args.size > 2 ? args[2] : {} ) config = CORL::Config.init_flat(options, [ :param, :global_hash ], { :hiera_scope => self, :puppet_scope => self, :search => 'core::default', :init_fact => 'hiera_ready', :force => true, :merge => true }) value = CORL::Config.lookup_hash(var_name, default, config) end return value end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
corl-0.4.2 | lib/puppet/parser/functions/global_hash.rb |
corl-0.4.1 | lib/puppet/parser/functions/global_hash.rb |
corl-0.4.0 | lib/puppet/parser/functions/global_hash.rb |