1 module Puppet::Parser::Functions
3 newfunction(:loadyaml, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
4 Load a YAML file containing an array, string, or hash, and return the data
5 in the corresponding native data type.
9 $myhash = loadyaml('/etc/puppet/data/myhash.yaml')
12 unless args.length == 1
13 raise Puppet::ParseError, ("loadyaml(): wrong number of arguments (#{args.length}; must be 1)")
16 YAML.load_file(args[0])