source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/get_module_path.rb@ 30903

Last change on this file since 30903 was 30903, checked in by davidb, 8 years ago

Vagrant provisioning files for a 4-node Hadoop cluster. See README.txt for more details

File size: 612 bytes
Line 
1module Puppet::Parser::Functions
2 newfunction(:get_module_path, :type =>:rvalue, :doc => <<-EOT
3 Returns the absolute path of the specified module for the current
4 environment.
5
6 Example:
7 $module_path = get_module_path('stdlib')
8 EOT
9 ) do |args|
10 raise(Puppet::ParseError, "get_module_path(): Wrong number of arguments, expects one") unless args.size == 1
11 if module_path = Puppet::Module.find(args[0], compiler.environment.to_s)
12 module_path.path
13 else
14 raise(Puppet::ParseError, "Could not find module #{args[0]} in environment #{compiler.environment}")
15 end
16 end
17end
Note: See TracBrowser for help on using the repository browser.