Sha256: 27898b9ab2c409a7fe54430bdab1a47d04de9056eedbb0b8a213f333d5f72601
Contents?: true
Size: 989 Bytes
Versions: 3
Compression:
Stored size: 989 Bytes
Contents
# # render.rb # # Returns the string-ified form of a given value or set of values. # module Puppet::Parser::Functions newfunction(:render, :type => :rvalue, :doc => <<-EOS This function returns the string-ified form of a given value. EOS ) do |args| value = nil CORL.run do raise(Puppet::ParseError, "render(): Must have a template class name and an optional source value specified; " + "given (#{args.size} for 2)") if args.size < 1 class_name = args[0] data = ( args.size > 1 ? args[1] : {} ) options = ( args.size > 2 ? args[2] : {} ) config = CORL::Config.init_flat(options, [ :data, :render ], { :hiera_scope => self, :puppet_scope => self, :search => 'core::default', :init_fact => 'hiera_ready', :force => true, :merge => true }) value = CORL.template(class_name, config).render(data) 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/render.rb |
corl-0.4.1 | lib/puppet/parser/functions/render.rb |
corl-0.4.0 | lib/puppet/parser/functions/render.rb |